8000 Remove slice · python/cpython@abfe46c · GitHub
[go: up one dir, main page]

Skip to content

Commit abfe46c

Browse files
committed
Remove slice
1 parent 72babad commit abfe46c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Lib/ntpath.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,12 @@ def join(path, *paths):
130130
# Same drive in different case
131131
result_drive = p_drive
132132
# Second path is relative to the first
133-
# gh-117349: Indexing bytes is not correct here
134-
if result_path and result_path[-1:] not in seps:
133+
if result_path and result_path[-1] not in seps:
135134
result_path = result_path + sep
136135
result_path = result_path + p_path
137136
## add separator between UNC and non-absolute path
138-
## Indexing bytes is not correct here
139137
if (result_path and not result_root and
140-
result_drive and result_drive[-1:] not in colon + seps):
138+
result_drive and result_drive[-1] not in colon + seps):
141139
return result_drive + sep + result_path
142140
return result_drive + result_root + result_path
143141
except (TypeError, AttributeError, BytesWarning):

0 commit comments

Comments
 (0)
0