Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Evan Edmond
fslpy
Commits
ee216387
Commit
ee216387
authored
Nov 07, 2017
by
Paul McCarthy
🚵
Browse files
Make all things in path module raise a PathError
parent
118d3779
Changes
1
Hide whitespace changes
Inline
Side-by-side
fsl/utils/path.py
View file @
ee216387
...
@@ -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:`
Value
Error` if a unique prefix could not be found (which
Raises a :exc:`
Path
Error` 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
Value
Error
(
'No unique prefix for {}'
.
format
(
filename
))
raise
Path
Error
(
'No unique prefix for {}'
.
format
(
filename
))
# Not unique - continue looping
# Not unique - continue looping
else
:
else
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment