summaryrefslogtreecommitdiff
path: root/composer.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2015-10-08 13:24:36 +0200
committerAnthon van der Neut <anthon@mnt.org>2015-10-08 13:24:36 +0200
commitd444338e4438323535476461414e1652bdd75cb3 (patch)
tree5d89094b84255ca652966457403fcb50d618ba4e /composer.py
parent5bccee8a4c79f291e54b73f8f2bc0b711994f81f (diff)
downloadruamel.yaml-d444338e4438323535476461414e1652bdd75cb3.tar.gz
Jython compatibility
Diffstat (limited to 'composer.py')
-rw-r--r--composer.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/composer.py b/composer.py
index 13436c8..a6bf24f 100644
--- a/composer.py
+++ b/composer.py
@@ -3,10 +3,16 @@ from __future__ import print_function
__all__ = ['Composer', 'ComposerError']
-from .error import MarkedYAMLError
-from .events import *
-from .nodes import *
-from .compat import utf8
+try:
+ from .error import MarkedYAMLError
+ from .events import *
+ from .nodes import *
+ from .compat import utf8
+except (ImportError, ValueError): # for Jython
+ from ruamel.yaml.error import MarkedYAMLError
+ from ruamel.yaml.events import *
+ from ruamel.yaml.nodes import *
+ from ruamel.yaml.compat import utf8
class ComposerError(MarkedYAMLError):