Commit a924bb1a authored by Skip Montanaro's avatar Skip Montanaro

split and join on "/" in commonprefix

parent fb625847
...@@ -120,11 +120,8 @@ def commonprefix(m): ...@@ -120,11 +120,8 @@ def commonprefix(m):
if not m: return '' if not m: return ''
n = m[:] n = m[:]
for i in range(len(n)): for i in range(len(n)):
n[i] = n[i].split(os.sep) n[i] = n[i].split("/")
# if os.sep didn't have any effect, try os.altsep
if os.altsep and len(n[i]) == 1:
n[i] = n[i].split(os.altsep)
prefix = n[0] prefix = n[0]
for item in n: for item in n:
for i in range(len(prefix)): for i in range(len(prefix)):
...@@ -132,7 +129,7 @@ def commonprefix(m): ...@@ -132,7 +129,7 @@ def commonprefix(m):
prefix = prefix[:i] prefix = prefix[:i]
if i == 0: return '' if i == 0: return ''
break break
return os.sep.join(prefix) return "/".join(prefix)
# Get size, mtime, atime of files. # Get size, mtime, atime of files.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment