Skip to content

Commit f412cb4

Browse files
committed
Add exc keyword and attribute to fs.errors.PathError
1 parent 60b0a63 commit f412cb4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/errors.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,14 @@ class PathError(FSError):
139139

140140
default_message = "path '{path}' is invalid"
141141

142-
def __init__(self, path, msg=None): # noqa: D107
143-
# type: (Text, Optional[Text]) -> None
142+
def __init__(self, path, msg=None, exc=None): # noqa: D107
143+
# type: (Text, Optional[Text], Optional[Exception]) -> None
144144
self.path = path
145+
self.exc = exc
145146
super(PathError, self).__init__(msg=msg)
146147

147148
def __reduce__(self):
148-
return type(self), (self.path, self._msg)
149+
return type(self), (self.path, self._msg, self.exc)
149150

150151

151152
class NoSysPath(PathError):

0 commit comments

Comments
 (0)