Skip to content

Commit e2e06f7

Browse files
committed
Revert changes to posixpath.join
1 parent 28a1c96 commit e2e06f7

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Lib/posixpath.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,29 +68,29 @@ def isabs(s):
6868
# Ignore the previous parts if a part is absolute.
6969
# Insert a '/' unless the first part is empty or already ends in '/'.
7070

71-
def join(path, *paths):
71+
def join(a, *p):
7272
"""Join two or more pathname components, inserting '/' as needed.
7373
If any component is an absolute path, all previous path components
7474
will be discarded. An empty last part will result in a path that
7575
ends with a separator."""
76-
path = os.fspath(path)
77-
sep = _get_sep(path)
78-
_path = path
76+
a = os.fspath(a)
77+
sep = _get_sep(a)
78+
path = a
7979
try:
80-
if not paths:
80+
if not p:
8181
# bpo-23780: Ensure compatible data type even if paths is empty.
82-
path[:0] + sep
83-
for p in map(os.fspath, paths):
84-
if p.startswith(sep):
85-
path = p
86-
elif not path or path.endswith(sep):
87-
path += p
82+
a[:0] + sep
83+
for b in map(os.fspath, p):
84+
if b.startswith(sep):
85+
a = b
86+
elif not a or a.endswith(sep):
87+
a += b
8888
else:
89-
path += sep + p
89+
a += sep + b
9090
except (TypeError, AttributeError, BytesWarning):
91-
genericpath._check_arg_types('join', _path, *paths)
91+
genericpath._check_arg_types('join', path, *p)
9292
raise
93-
return path
93+
return a
9494

9595

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

0 commit comments

Comments
 (0)