Skip to content

Commit ff426eb

Browse files
committed
Merge remote-tracking branch 'immerrr/make-exceptions-picklable'
* immerrr/make-exceptions-picklable: Make exceptions picklable on Python 2.X
2 parents 642c802 + 0a51b66 commit ff426eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jsonschema/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ def __init__(
2727
schema_path=(),
2828
parent=None,
2929
):
30+
# Calling __init__ is important, because otherwise __reduce__ will
31+
# return empty args tuple on Py2.7 and unpickling will fail because
32+
# init requires at least one argument.
33+
super(_Error, self).__init__(message)
3034
self.message = message
3135
self.path = self.relative_path = deque(path)
3236
self.schema_path = self.relative_schema_path = deque(schema_path)

0 commit comments

Comments
 (0)