Irit Katriel <iritkatr...@gmail.com> added the comment:

The default __reduce__ method of Exception returns the arg you pass to the 
Exception constructor:

>>> a = ExcA("a banana")
>>> a.__reduce__()
(<class '__main__.ExcA'>, ('missing a banana',))
>>> 


This is then pickled, and when unpickled the arg is passed to the ExcA 
constructor. 

If you want to change this, you can implement __reduce__ on ExcA o return just 
the part you want it to return.

----------
nosy: +iritkatriel

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45112>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to