8000 Remove `isabs` calls · python/cpython@78929b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 78929b0

Browse files
committed
Remove isabs calls
1 parent a8984dc commit 78929b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/posixpath.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ def normpath(path):
374374
def abspath(path):
375375
"""Return an absolute path."""
376376
path = os.fspath(path)
377-
if not isabs(path):
377+
sep = _get_sep(path)
378+
if path[:1] != sep:
378379
if isinstance(path, bytes):
379380
cwd = os.getcwdb()
380381
else:
@@ -405,7 +406,7 @@ def _joinrealpath(path, rest, strict, seen):
405406
curdir = '.'
406407
pardir = '..'
407408

408-
if isabs(rest):
409+
if rest[:1] == sep:
409410
rest = rest[1:]
410411
path = sep
411412

0 commit comments

Comments
 (0)
0