Skip to content

Commit 7e9eed9

Browse files
committed
upip: Fix handling of non-existing absolute install paths.
The latest refactor of _makedirs() had a buf preventing to create them properly.
1 parent d5d2395 commit 7e9eed9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

upip/upip.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ def op_basename(path):
3636
def _makedirs(name, mode=0o777):
3737
ret = False
3838
s = ""
39-
for c in name.rstrip("/").split("/")[:-1]:
40-
if s:
39+
comps = name.rstrip("/").split("/")[:-1]
40+
if comps[0] == "":
41+
s = "/"
42+
for c in comps:
43+
if s and s[-1] != "/":
4144
s += "/"
4245
s += c
4346
try:

0 commit comments

Comments
 (0)