use pathlib2 up to python3.4 - damn the stdlib

This commit is contained in:
Ronny Pfannschmidt
2018-06-19 19:45:20 +02:00
parent 1226cdab47
commit abbf73ad1a
2 changed files with 10 additions and 5 deletions

View File

@@ -30,11 +30,8 @@ _PY2 = not _PY3
if _PY3:
from inspect import signature, Parameter as Parameter
from pathlib import Path
else:
from funcsigs import signature, Parameter as Parameter
from pathlib2 import Path
NoneType = type(None)
NOTSET = object()
@@ -43,6 +40,12 @@ PY35 = sys.version_info[:2] >= (3, 5)
PY36 = sys.version_info[:2] >= (3, 6)
MODULE_NOT_FOUND_ERROR = "ModuleNotFoundError" if PY36 else "ImportError"
if PY35:
from pathlib import Path
else:
from pathlib2 import Path
if _PY3:
from collections.abc import MutableMapping as MappingMixin # noqa
from collections.abc import Mapping, Sequence # noqa