mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
bpo-31802: Fix importing native path module before importing os. (#4017)
This commit is contained in:
parent
e46a8af450
commit
3460198f6b
5 changed files with 42 additions and 32 deletions
|
@ -5,6 +5,18 @@ Instead of importing this module directly, import os and refer to this
|
|||
module as os.path.
|
||||
"""
|
||||
|
||||
# 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 = ';'
|
||||
altsep = '/'
|
||||
defpath = '.;C:\\bin'
|
||||
devnull = 'nul'
|
||||
|
||||
import os
|
||||
import sys
|
||||
import stat
|
||||
|
@ -19,17 +31,6 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
|
|||
"extsep","devnull","realpath","supports_unicode_filenames","relpath",
|
||||
"samefile", "sameopenfile", "samestat", "commonpath"]
|
||||
|
||||
# strings representing various path-related bits and pieces
|
||||
# These are primarily for export; internally, they are hardcoded.
|
||||
curdir = '.'
|
||||
pardir = '..'
|
||||
extsep = '.'
|
||||
sep = '\\'
|
||||
pathsep = ';'
|
||||
altsep = '/'
|
||||
defpath = '.;C:\\bin'
|
||||
devnull = 'nul'
|
||||
|
||||
def _get_bothseps(path):
|
||||
if isinstance(path, bytes):
|
||||
return b'\\/'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue