From d444338e4438323535476461414e1652bdd75cb3 Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Thu, 8 Oct 2015 13:24:36 +0200 Subject: Jython compatibility --- scalarstring.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scalarstring.py') diff --git a/scalarstring.py b/scalarstring.py index a628396..59951c9 100644 --- a/scalarstring.py +++ b/scalarstring.py @@ -3,7 +3,11 @@ from __future__ import print_function __all__ = ["ScalarString", "PreservedScalarString"] -from .compat import text_type +try: + from .compat import text_type +except (ImportError, ValueError): # for Jython + from ruamel.yaml.compat import text_type + class ScalarString(text_type): -- cgit v1.2.1