We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcc160e commit b769371Copy full SHA for b769371
Lib/ntpath.py
@@ -580,10 +580,12 @@ def abspath(path):
580
pass
581
path = os.fspath(path)
582
if not isabs(path):
583
- if is_bytes := isinstance(path, bytes):
+ if isinstance(path, bytes):
584
sep = b'\\'
585
+ getcwd = os.getcwdb
586
else:
587
sep = '\\'
588
+ getcwd = os.getcwd
589
drive, root, path = splitroot(path)
590
# Either drive or root can be nonempty, but not both.
591
if drive or root:
@@ -593,8 +595,7 @@ def abspath(path):
593
595
# Drive "\0:" cannot exist; use the root directory.
594
596
path = drive + sep + path
597
- cwd = os.getcwdb() if is_bytes else os.getcwd()
- path = join(cwd, path)
598
+ path = join(getcwd(), path)
599
return normpath(path)
600
601
try:
0 commit comments