Skip to content

Commit 0725beb

Browse files
committed
Correct reverted changes
1 parent e2e06f7 commit 0725beb

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Lib/posixpath.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,18 @@ def join(a, *p):
7878
path = a
7979
try:
8080
if not p:
81-
# bpo-23780: Ensure compatible data type even if paths is empty.
82-
a[:0] + sep
81+
path[:0] + sep #23780: Ensure compatible data type even if p is null.
8382
for b in map(os.fspath, p):
8483
if b.startswith(sep):
85-
a = b
86-
elif not a or a.endswith(sep):
87-
a += b
84+
path = b
85+
elif not path or path.endswith(sep):
86+
path += b
8887
else:
89-
a += sep + b
88+
path += sep + b
9089
except (TypeError, AttributeError, BytesWarning):
91-
genericpath._check_arg_types('join', path, *p)
90+
genericpath._check_arg_types('join', a, *p)
9291
raise
93-
return a
92+
return path
9493

9594

9695
# Split a path in head (everything up to the last '/') and tail (the

0 commit comments

Comments
 (0)