diff --git a/gen/models/base.py b/gen/models/base.py index 39db7473..435eeb5b 100644 --- a/gen/models/base.py +++ b/gen/models/base.py @@ -262,7 +262,8 @@ def _loadYaml(yaml_text): warnings.simplefilter("ignore", yaml.error.UnsafeLoaderWarning) # with open(self.full_filename, 'r') as stream: try: - return yaml.load(yaml_text, Loader=yaml.RoundTripLoader) + yml = yaml.YAML(typ='rt') + return yml.load(yaml_text) # import sys # sys.stderr.write(str(self.data) + "\n") # sys.stderr.write(str(type(self.data)) + "\n") diff --git a/gen/models/exceptions.py b/gen/models/exceptions.py index 2ff85a7c..de937f1e 100644 --- a/gen/models/exceptions.py +++ b/gen/models/exceptions.py @@ -36,7 +36,7 @@ def inner(*args, **kwargs): # Decorator which catches a model exception and addes # a line number if the argument of the function contains # an attribue "lc.line" which is the line number attribute -# of a rout trip loaded yaml dictionary from ruamel.yaml +# of a round trip loaded yaml dictionary from ruamel.yaml def throw_exception_with_lineno(func): def inner(*args, **kwargs): try: diff --git a/redo/bin/yaml_sloc_counter.py b/redo/bin/yaml_sloc_counter.py index dbbddaa2..8a951a6d 100755 --- a/redo/bin/yaml_sloc_counter.py +++ b/redo/bin/yaml_sloc_counter.py @@ -14,7 +14,8 @@ def _loadYaml(yaml_text): import warnings warnings.simplefilter("ignore", yaml.error.UnsafeLoaderWarning) - return yaml.load(yaml_text, Loader=yaml.RoundTripLoader) + yml = yaml.YAML(typ='rt') + return yml.load(yaml_text) # Open and read the yaml file: with open(yaml_file, "r") as f: