Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0d05a769
Commit
0d05a769
authored
Apr 21, 2012
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have importlib look for pre-existing path separators when joining
paths.
parent
cb165db3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2991 additions
and
2979 deletions
+2991
-2979
Lib/importlib/_bootstrap.py
Lib/importlib/_bootstrap.py
+10
-2
Python/importlib.h
Python/importlib.h
+2981
-2977
No files found.
Lib/importlib/_bootstrap.py
View file @
0d05a769
...
...
@@ -63,8 +63,16 @@ def _r_long(int_bytes):
def
_path_join
(
*
args
):
"""Replacement for os.path.join()."""
sep
=
path_sep
if
args
[
0
][
-
1
:]
not
in
path_separators
else
args
[
0
][
-
1
]
return
sep
.
join
(
x
[:
-
len
(
path_sep
)]
if
x
.
endswith
(
path_sep
)
else
x
if
len
(
path_separators
)
==
1
:
sep
=
path_sep
else
:
for
c
in
reversed
(
args
[
0
]):
if
x
in
path_separators
:
sep
=
x
break
else
:
sep
=
path_sep
return
sep
.
join
(
x
[:
-
len
(
sep
)]
if
x
.
endswith
(
sep
)
else
x
for
x
in
args
if
x
)
...
...
Python/importlib.h
View file @
0d05a769
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment