Skip to content

Commit

Permalink
Avoid os.path.commonpath that is new in 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
zimeon committed Feb 21, 2019
1 parent 51872bd commit 09676b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocfl/dispositor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self):
def strip_root(self, path, root):
"""Remove root from path, throw exception on failure."""
root = root.rstrip(os.sep) # ditch any trailing path separator
if os.path.commonpath((path, root)) == root:
if os.path.commonprefix((path, root)) == root:
return os.path.relpath(path, start=root)
else:
raise Exception("Path %s is not in root %s" % (path, root))
Expand Down

0 comments on commit 09676b2

Please sign in to comment.