diff options
| author | Brett Cannon <brett@python.org> | 2012-04-22 06:06:23 (GMT) |
|---|---|---|
| committer | Brett Cannon <brett@python.org> | 2012-04-22 06:06:23 (GMT) |
| commit | cf649958f72efbe2d68ffcfcb0a01ce53ff69f88 (patch) | |
| tree | 7bf6473edf69e13cadf5e60a8009c2d3eaa4b867 /Lib/importlib/_bootstrap.py | |
| parent | 6c802b8491200ac360ff407603f72704f4ccdf66 (diff) | |
| download | cpython-cf649958f72efbe2d68ffcfcb0a01ce53ff69f88.zip cpython-cf649958f72efbe2d68ffcfcb0a01ce53ff69f88.tar.gz cpython-cf649958f72efbe2d68ffcfcb0a01ce53ff69f88.tar.bz2 | |
Revert to os.path.join() semantics for path manipulation in importlib
which is different than what imp.cache_from_source() operates on.
Diffstat (limited to 'Lib/importlib/_bootstrap.py')
| -rw-r--r-- | Lib/importlib/_bootstrap.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 46a7029..a705bf8 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -65,17 +65,8 @@ def _r_long(int_bytes): # and choosing in _setup(). def _path_join(*args): """Replacement for os.path.join().""" - if len(path_separators) == 1: - sep = path_sep - else: - for x 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) + return path_sep.join(x[:-len(path_sep)] if x.endswith(path_sep) else x + for x in args if x) def _path_split(path): |
