Commit 1e8f893b by btimby

Don't derive BackReferenceError from FSError. See comments on r773.

parent bc88a85a
...@@ -188,9 +188,8 @@ class NoMMapError(ResourceError): ...@@ -188,9 +188,8 @@ class NoMMapError(ResourceError):
default_message = "Can't get mmap for %(path)s" default_message = "Can't get mmap for %(path)s"
class BackReferenceError(FSError, ValueError): class BackReferenceError(ValueError):
"""Exception raised when too many backrefs exist in a path (ex: '/..', '/docs/../..').""" """Exception raised when too many backrefs exist in a path (ex: '/..', '/docs/../..')."""
default_message = "Too many backrefs in '%(path)s'"
def convert_fs_errors(func): def convert_fs_errors(func):
......
...@@ -60,7 +60,7 @@ def normpath(path): ...@@ -60,7 +60,7 @@ def normpath(path):
# Imported here because errors imports this module (path), # Imported here because errors imports this module (path),
# causing a circular import. # causing a circular import.
from fs.errors import BackReferenceError from fs.errors import BackReferenceError
BackReferenceError(details={ 'path': path }) BackReferenceError('Too many backrefs in \'%s\'' % path)
if path[0] == '/': if path[0] == '/':
return '/%s' % '/'.join(components) return '/%s' % '/'.join(components)
return '/'.join(components) return '/'.join(components)
......
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