diff --git a/pyraml/__init__.py b/pyraml/__init__.py index 99682f0..9c8e6db 100644 --- a/pyraml/__init__.py +++ b/pyraml/__init__.py @@ -1,7 +1,7 @@ __author__ = 'ad' import mimetypes -import yaml +import imp try: from collections import OrderedDict except ImportError: @@ -11,6 +11,10 @@ from .raml_elements import ParserRamlInclude from .constants import RAML_CONTENT_MIME_TYPES + +yaml = imp.load_module('pyraml_yaml', *imp.find_module('yaml')) + + class ValidationError(Exception): def __init__(self, validation_errors): self.errors = validation_errors diff --git a/pyraml/parser.py b/pyraml/parser.py index 7889f9d..0a2588d 100644 --- a/pyraml/parser.py +++ b/pyraml/parser.py @@ -5,7 +5,7 @@ import mimetypes import os.path import codecs -import yaml +import imp import json try: from collections import OrderedDict @@ -28,6 +28,7 @@ __all__ = ["RamlException", "RamlNotFoundException", "RamlParseException", "ParseContext", "load", "parse"] +yaml = imp.load_module('pyraml_yaml', *imp.find_module('yaml')) class RamlException(Exception): diff --git a/pyraml/raml_elements.py b/pyraml/raml_elements.py index e710c53..af1cb42 100644 --- a/pyraml/raml_elements.py +++ b/pyraml/raml_elements.py @@ -1,6 +1,9 @@ __author__ = 'ad' -import yaml +import imp + + +yaml = imp.load_module('pyraml_yaml', *imp.find_module('yaml')) class ParserRamlInclude(yaml.YAMLObject):