gh-118263: Add additional arguments to path_t (Argument Clinic type) in posixmodule (GH-119608)

This commit is contained in:
Nice Zombies 2024-05-28 12:13:01 +02:00 committed by GitHub
parent ab9b605efa
commit 09a85eaa4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 317 additions and 270 deletions

View file

@ -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."""