Fix for pickling exception when deserializing GithubException.

See: https://bugs.python.org/issue9400

"Because CalledProcessError extends PyExc_BaseException, which defines a __reduce__ method, that special method cause the pickle load to call the exception type's __init__ method with packed self.args as arguments. So if a subclass of "Exception" needs to behave correctly in pickling, it should make self.args meet its __init__ method's function signature. "
This commit is contained in:
humbug
2016-04-04 16:47:43 -07:00
parent fadb7d75a5
commit 8f8b455a35
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -36,6 +36,7 @@ class GithubException(Exception):
Exception.__init__(self)
self.__status = status
self.__data = data
self.args = [status, data]
@property
def status(self):