Skip to content

Commit cf64995

Browse files
committed
Revert to os.path.join() semantics for path manipulation in importlib
which is different than what imp.cache_from_source() operates on.
1 parent 6c802b8 commit cf64995

2 files changed

Lines changed: 2966 additions & 2985 deletions

File tree

‎Lib/importlib/_bootstrap.py‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,8 @@ def _r_long(int_bytes):
6565
# and choosing in _setup().
6666
def _path_join(*args):
6767
"""Replacement for os.path.join()."""
68-
if len(path_separators) == 1:
69-
sep = path_sep
70-
else:
71-
for x in reversed(args[0]):
72-
if x in path_separators:
73-
sep = x
74-
break
75-
else:
76-
sep = path_sep
77-
return sep.join(x[:-len(sep)] if x.endswith(sep) else x
78-
for x in args if x)
68+
return path_sep.join(x[:-len(path_sep)] if x.endswith(path_sep) else x
69+
for x in args if x)
7970

8071

8172
def _path_split(path):

0 commit comments

Comments
 (0)