mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-118263: Add additional arguments to path_t (Argument Clinic type) in posixmodule (GH-119608)
This commit is contained in:
parent
ab9b605efa
commit
09a85eaa4c
7 changed files with 317 additions and 270 deletions
|
@ -521,7 +521,7 @@ def expandvars(path):
|
|||
# Previously, this function also truncated pathnames to 8+3 format,
|
||||
# but as this module is called "ntpath", that's obviously wrong!
|
||||
try:
|
||||
from nt import _path_normpath
|
||||
from nt import _path_normpath as normpath
|
||||
|
||||
except ImportError:
|
||||
def normpath(path):
|
||||
|
@ -560,14 +560,6 @@ except ImportError:
|
|||
comps.append(curdir)
|
||||
return prefix + sep.join(comps)
|
||||
|
||||
else:
|
||||
def normpath(path):
|
||||
"""Normalize path, eliminating double slashes, etc."""
|
||||
path = os.fspath(path)
|
||||
if isinstance(path, bytes):
|
||||
return os.fsencode(_path_normpath(os.fsdecode(path))) or b"."
|
||||
return _path_normpath(path) or "."
|
||||
|
||||
|
||||
def _abspath_fallback(path):
|
||||
"""Return the absolute version of a path as a fallback function in case
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue