Patch 533291. Deprecate None return form of __reduce__.

This commit is contained in:
Raymond Hettinger 2002-05-21 17:22:02 +00:00
parent 7f7d5bf438
commit 97394bc795
2 changed files with 12 additions and 4 deletions

View file

@ -862,6 +862,10 @@ class Unpickler:
"unpickling" % callable
if arg_tup is None:
import warnings
warnings.warn("The None return argument form of __reduce__ is "
"deprecated. Return a tuple of arguments instead.",
DeprecationWarning)
value = callable.__basicnew__()
else:
value = apply(callable, arg_tup)