Commit ee216387 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Make all things in path module raise a PathError

parent 118d3779
...@@ -424,7 +424,7 @@ def uniquePrefix(path): ...@@ -424,7 +424,7 @@ def uniquePrefix(path):
"""Return the longest prefix for the given file name which unambiguously """Return the longest prefix for the given file name which unambiguously
identifies it, relative to the other files in the same directory. identifies it, relative to the other files in the same directory.
Raises a :exc:`ValueError` if a unique prefix could not be found (which Raises a :exc:`PathError` if a unique prefix could not be found (which
will never happen if the path is valid). will never happen if the path is valid).
""" """
...@@ -442,7 +442,7 @@ def uniquePrefix(path): ...@@ -442,7 +442,7 @@ def uniquePrefix(path):
# Should never happen if path is valid # Should never happen if path is valid
elif len(hits) == 0 or idx >= len(filename) - 1: elif len(hits) == 0 or idx >= len(filename) - 1:
raise ValueError('No unique prefix for {}'.format(filename)) raise PathError('No unique prefix for {}'.format(filename))
# Not unique - continue looping # Not unique - continue looping
else: else:
......
Supports Markdown
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