summaryrefslogtreecommitdiffstats
path: root/Lib/macpath.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-01-07 16:35:28 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-01-07 16:35:28 (GMT)
commit94a3facc0e5ce02ef34d9fa595703cd96cb95984 (patch)
tree6cf9454f7d736790390f1b701df5ae9026afc92d /Lib/macpath.py
parent157be7ca1de0d046a092e2d44d6d7200de6add8b (diff)
downloadcpython-94a3facc0e5ce02ef34d9fa595703cd96cb95984.zip
cpython-94a3facc0e5ce02ef34d9fa595703cd96cb95984.tar.gz
cpython-94a3facc0e5ce02ef34d9fa595703cd96cb95984.tar.bz2
bpo-31802: Fix importing native path module before importing os. (GH-4017) (#5129)
(cherry picked from commit 3460198f6ba40a839f105c381f07179aba1e8c61)
Diffstat (limited to 'Lib/macpath.py')
-rw-r--r--Lib/macpath.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/Lib/macpath.py b/Lib/macpath.py
index a90d105..d15b7e1 100644
--- a/Lib/macpath.py
+++ b/Lib/macpath.py
@@ -1,5 +1,17 @@
"""Pathname and path-related operations for the Macintosh."""
+# 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 = '\n'
+defpath = ':'
+altsep = None
+devnull = 'Dev:Null'
+
import os
from stat import *
import genericpath
@@ -12,17 +24,6 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"curdir","pardir","sep","pathsep","defpath","altsep","extsep",
"devnull","realpath","supports_unicode_filenames"]
-# strings representing various path-related bits and pieces
-# These are primarily for export; internally, they are hardcoded.
-curdir = ':'
-pardir = '::'
-extsep = '.'
-sep = ':'
-pathsep = '\n'
-defpath = ':'
-altsep = None
-devnull = 'Dev:Null'
-
def _get_colon(path):
if isinstance(path, bytes):
return b':'