mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +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
|
@ -371,7 +371,7 @@ def expandvars(path):
|
|||
# if it contains symbolic links!
|
||||
|
||||
try:
|
||||
from posix import _path_normpath
|
||||
from posix import _path_normpath as normpath
|
||||
|
||||
except ImportError:
|
||||
def normpath(path):
|
||||
|
@ -404,14 +404,6 @@ except ImportError:
|
|||
path = initial_slashes + sep.join(comps)
|
||||
return path or dot
|
||||
|
||||
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(path):
|
||||
"""Return an absolute path."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue