diff options
author | Anthon van der Neut <anthon@mnt.org> | 2015-10-08 13:24:36 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2015-10-08 13:24:36 +0200 |
commit | d444338e4438323535476461414e1652bdd75cb3 (patch) | |
tree | 5d89094b84255ca652966457403fcb50d618ba4e /scanner.py | |
parent | 5bccee8a4c79f291e54b73f8f2bc0b711994f81f (diff) | |
download | ruamel.yaml-d444338e4438323535476461414e1652bdd75cb3.tar.gz |
Jython compatibility
Diffstat (limited to 'scanner.py')
-rw-r--r-- | scanner.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -31,9 +31,15 @@ from __future__ import print_function __all__ = ['Scanner', 'RoundTripScanner', 'ScannerError'] -from .error import MarkedYAMLError -from .tokens import * -from .compat import utf8, unichr, PY3 +try: + from .error import MarkedYAMLError + from .tokens import * + from .compat import utf8, unichr, PY3 +except (ImportError, ValueError): # for Jython + from ruamel.yaml.error import MarkedYAMLError + from ruamel.yaml.tokens import * + from ruamel.yaml.compat import utf8, unichr, PY3 + class ScannerError(MarkedYAMLError): |