Skip to content
Snippets Groups Projects
Commit 6ae4910d authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

BF: Adjustments to commonBase function

parent c63487f8
No related branches found
No related tags found
No related merge requests found
......@@ -485,14 +485,17 @@ def commonBase(paths):
depths = [len(p.split(op.sep)) for p in paths]
base = max(zip(depths, paths), key=operator.itemgetter(0))[1]
last = base
while True:
base = op.split(base)[0]
if len(base) == 0:
if base == last or len(base) == 0:
break
last = base
if all([p.startswith(base) for p in paths]):
return base
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment