diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-01-07 16:35:28 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-01-07 16:35:28 (GMT) |
commit | 94a3facc0e5ce02ef34d9fa595703cd96cb95984 (patch) | |
tree | 6cf9454f7d736790390f1b701df5ae9026afc92d /Lib/macpath.py | |
parent | 157be7ca1de0d046a092e2d44d6d7200de6add8b (diff) | |
download | cpython-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.py | 23 |
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':' |