mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
gh-117636: Remove redundant type check in os.path.join()
(#117638)
This commit is contained in:
parent
e01831760e
commit
9ee94d1391
4 changed files with 5 additions and 6 deletions
|
@ -77,13 +77,11 @@ def join(a, *p):
|
|||
sep = _get_sep(a)
|
||||
path = a
|
||||
try:
|
||||
if not p:
|
||||
path[:0] + sep #23780: Ensure compatible data type even if p is null.
|
||||
for b in p:
|
||||
b = os.fspath(b)
|
||||
if b.startswith(sep):
|
||||
if b.startswith(sep) or not path:
|
||||
path = b
|
||||
elif not path or path.endswith(sep):
|
||||
elif path.endswith(sep):
|
||||
path += b
|
||||
else:
|
||||
path += sep + b
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue