summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-01-07 15:54:31 (GMT)
committerGitHub <noreply@github.com>2018-01-07 15:54:31 (GMT)
commit3460198f6ba40a839f105c381f07179aba1e8c61 (patch)
tree1b43b27d96931ebfd4c7f23758da932d42c0940e /Lib/posixpath.py
parente46a8af450210ee5c7f0459ad6beddbc626ae60f (diff)
downloadcpython-3460198f6ba40a839f105c381f07179aba1e8c61.zip
cpython-3460198f6ba40a839f105c381f07179aba1e8c61.tar.gz
cpython-3460198f6ba40a839f105c381f07179aba1e8c61.tar.bz2
bpo-31802: Fix importing native path module before importing os. (#4017)
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 6dbdab2..e92186c 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -10,6 +10,18 @@ Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
"""
+# Strings representing various path-related bits and pieces.
+# These are primarily for export; internally, they are hardcoded.
+# Should be set before imports for resolving cyclic dependency.
+curdir = '.'
+pardir = '..'
+extsep = '.'
+sep = '/'
+pathsep = ':'
+defpath = ':/bin:/usr/bin'
+altsep = None
+devnull = '/dev/null'
+
import os
import sys
import stat
@@ -25,16 +37,6 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"devnull","realpath","supports_unicode_filenames","relpath",
"commonpath"]
-# Strings representing various path-related bits and pieces.
-# These are primarily for export; internally, they are hardcoded.
-curdir = '.'
-pardir = '..'
-extsep = '.'
-sep = '/'
-pathsep = ':'
-defpath = ':/bin:/usr/bin'
-altsep = None
-devnull = '/dev/null'
def _get_sep(path):
if isinstance(path, bytes):