diff --git a/pyyaml_loaders/IncludeLoader.py b/pyyaml_loaders/IncludeLoader.py index daeac39e6c523f875d6629b0b8ce53ee78c07433..5bc725085b8f54e6848ebdccb40ad4e0e4b82f66 100644 --- a/pyyaml_loaders/IncludeLoader.py +++ b/pyyaml_loaders/IncludeLoader.py @@ -8,7 +8,7 @@ import yaml import collections.abc # Import IgnoreLoader -from IgnoreLoader import IgnoreLoader +from .IgnoreLoader import IgnoreLoader class IncludeLoader(yaml.SafeLoader): diff --git a/pyyaml_loaders/__init__.py b/pyyaml_loaders/__init__.py index b5564c6577ff1bb93efe472800d1300cbeaaf1df..51a36587b8b995fcd3251c3ab28c4b848e5f4e71 100644 --- a/pyyaml_loaders/__init__.py +++ b/pyyaml_loaders/__init__.py @@ -2,10 +2,11 @@ Initialization script for package `pyyaml_loaders`. """ -import yaml -from IncludeLoader import IncludeLoader, construct_include -from IgnoreLoader import IgnoreLoader, construct_ignore +from .IgnoreLoader import IgnoreLoader +from .IncludeLoader import IncludeLoader -# Add custom constructors -yaml.add_constructor("!include", construct_include, IncludeLoader) -yaml.add_multi_constructor("!", construct_ignore, IgnoreLoader) +# Expose custom constructors +__all__ = [ + "IgnoreLoader", + "IncludeLoader" +]