mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Fix macpath to deal with bytes
This commit is contained in:
parent
c9c79784cf
commit
19b02d4558
1 changed files with 5 additions and 1 deletions
|
@ -172,7 +172,11 @@ def normpath(s):
|
||||||
def abspath(path):
|
def abspath(path):
|
||||||
"""Return an absolute path."""
|
"""Return an absolute path."""
|
||||||
if not isabs(path):
|
if not isabs(path):
|
||||||
path = join(os.getcwd(), path)
|
if isinstance(path, bytes):
|
||||||
|
cwd = os.getcwdb()
|
||||||
|
else:
|
||||||
|
cwd = os.getcwd()
|
||||||
|
path = join(cwd, path)
|
||||||
return normpath(path)
|
return normpath(path)
|
||||||
|
|
||||||
# realpath is a no-op on systems without islink support
|
# realpath is a no-op on systems without islink support
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue