summaryrefslogtreecommitdiff
path: root/emitter.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 /emitter.py
parent5bccee8a4c79f291e54b73f8f2bc0b711994f81f (diff)
downloadruamel.yaml-d444338e4438323535476461414e1652bdd75cb3.tar.gz
Jython compatibility
Diffstat (limited to 'emitter.py')
-rw-r--r--emitter.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/emitter.py b/emitter.py
index 2e5ebdc..07d85ba 100644
--- a/emitter.py
+++ b/emitter.py
@@ -10,9 +10,15 @@ from __future__ import print_function
__all__ = ['Emitter', 'EmitterError']
-from .error import YAMLError
-from .events import *
-from .compat import utf8, text_type, PY2, nprint, dbg, DBG_EVENT
+try:
+ from .error import YAMLError
+ from .events import *
+ from .compat import utf8, text_type, PY2, nprint, dbg, DBG_EVENT
+except (ImportError, ValueError): # for Jython
+ from ruamel.yaml.error import YAMLError
+ from ruamel.yaml.events import *
+ from ruamel.yaml.compat import utf8, text_type, PY2, nprint, dbg, DBG_EVENT
+
class EmitterError(YAMLError):