]> granicus.if.org Git - python/commit
Two changes:
authorBarry Warsaw <barry@python.org>
Thu, 15 Nov 2001 23:42:58 +0000 (23:42 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 15 Nov 2001 23:42:58 +0000 (23:42 +0000)
commitbf4d959d28eacf5c57afe56abbf463272cef7557
tree229698f4a1363f3a22b1482e6fdfad9ca2a67fab
parentf595fd975da6338ae7b5a5355833ee73d924ed20
Two changes:

load_inst(): Implement the security hook that cPickle already had.
When unpickling callables which are not classes, we look to see if the
object has an attribute __safe_for_unpickling__.  If this exists and
has a true value, then we can call it to create the unpickled object.
Otherwise we raise an UnpicklingError.

find_class(): We no longer mask ImportError, KeyError, and
AttributeError by transforming them into SystemError.  The latter is
definitely not the right thing to do, so we let the former three
exceptions simply propagate up if they occur, i.e. we remove the
try/except!
Lib/pickle.py