File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -35,15 +35,18 @@ def isabs(s):
35
35
return s != '' and s [:1 ] in '/\\ '
36
36
37
37
38
- # Join two pathnames.
39
- # Ignore the first part if the second part is absolute.
40
- # Insert a '/' unless the first part is empty or already ends in '/'.
41
-
42
- def join (a , b ):
43
- if isabs (b ): return b
44
- if a == '' or a [- 1 :] in '/\\ ' : return a + b
45
- # Note: join('x', '') returns 'x/'; is this what we want?
46
- return a + os .sep + b
38
+ # Join two (or more) paths.
39
+
40
+ def join (a , * p ):
41
+ path = a
42
+ for b in p :
43
+ if isabs (b ):
44
+ path = b
45
+ elif path == '' or path [- 1 :] in '/\\ ' :
46
+ path = path + b
47
+ else :
48
+ path = path + os .sep + b
49
+ return path
47
50
48
51
49
52
# Split a path in a drive specification (a drive letter followed by a
You can’t perform that action at this time.
0 commit comments