summaryrefslogtreecommitdiff
path: root/cyaml.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-03-22 15:53:24 +0100
committerAnthon van der Neut <anthon@mnt.org>2017-03-22 15:53:24 +0100
commit40c95ca1b92ced97ba85b1a1dd5b46754f6ab0c7 (patch)
treedc52888ff411545a6546fc1638ecd242aeb25247 /cyaml.py
parentc15232bf77e29c1e739d8632cd3d2a48909c4f05 (diff)
downloadruamel.yaml-40c95ca1b92ced97ba85b1a1dd5b46754f6ab0c7.tar.gz
fix issue 106, Text undefined in 3.5.10.14.1
Reported by Charles Bouchard-L?gar?
Diffstat (limited to 'cyaml.py')
-rw-r--r--cyaml.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/cyaml.py b/cyaml.py
index 2223a5b..41d2d08 100644
--- a/cyaml.py
+++ b/cyaml.py
@@ -2,7 +2,8 @@
from __future__ import absolute_import
-from typing import Any, Union # NOQA
+import sys
+
from _ruamel_yaml import CParser, CEmitter # type: ignore
@@ -11,7 +12,9 @@ from ruamel.yaml.serializer import Serializer
from ruamel.yaml.representer import Representer, SafeRepresenter, BaseRepresenter
from ruamel.yaml.resolver import Resolver, BaseResolver
-from ruamel.yaml.compat import StreamTextType, StreamType, VersionType # NOQA
+if sys.version_info >= (3, 5, 2):
+ from typing import Any, Union # NOQA
+ from ruamel.yaml.compat import StreamTextType, StreamType, VersionType # NOQA
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',
'CBaseDumper', 'CSafeDumper', 'CDumper']