diff --git a/SemiBin/atomicwrite.py b/SemiBin/atomicwrite.py index 5afdd8c..6aae830 100644 --- a/SemiBin/atomicwrite.py +++ b/SemiBin/atomicwrite.py @@ -8,23 +8,14 @@ import sys import tempfile import errno +from os import fspath try: import fcntl except ImportError: fcntl = None -# `fspath` was added in Python 3.6 -try: - from os import fspath -except ImportError: - fspath = None - - -PY2 = sys.version_info[0] == 2 - -text_type = unicode if PY2 else str # noqa - +DEFAULT_MODE = "wb" def _path_to_unicode(x): if not isinstance(x, text_type): @@ -32,9 +23,6 @@ def _path_to_unicode(x): return x -DEFAULT_MODE = "wb" if PY2 else "w" - - _proper_fsync = os.fsync