summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-12-07 07:05:57 +0000
committerRaymond Hettinger <python@rcn.com>2004-12-07 07:05:57 +0000
commita6b45cc31d33c166c84866f78d504a99d409895c (patch)
treedaffa37b19305cdf19902242a177ed436e396fb1 /Lib
parent84667c063a1e93a985134f7cef376edf82941c02 (diff)
downloadcpython-git-a6b45cc31d33c166c84866f78d504a99d409895c.tar.gz
Eliminate the deprecated option to return None instead of a tuple of arguments in __reduce__().
Diffstat (limited to 'Lib')
-rw-r--r--Lib/pickle.py18
1 files changed, 2 insertions, 16 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 4c9188830a..02a1b1d1ae 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -33,7 +33,6 @@ import marshal
import sys
import struct
import re
-import warnings
__all__ = ["PickleError", "PicklingError", "UnpicklingError", "Pickler",
"Unpickler", "dump", "dumps", "load", "loads"]
@@ -349,14 +348,7 @@ class Pickler:
# Assert that args is a tuple or None
if not isinstance(args, TupleType):
- if args is None:
- # A hack for Jim Fulton's ExtensionClass, now deprecated.
- # See load_reduce()
- warnings.warn("__basicnew__ special case is deprecated",
- DeprecationWarning)
- else:
- raise PicklingError(
- "args from reduce() should be a tuple")
+ raise PicklingError("args from reduce() should be a tuple")
# Assert that func is callable
if not callable(func):
@@ -1138,13 +1130,7 @@ class Unpickler:
stack = self.stack
args = stack.pop()
func = stack[-1]
- if args is None:
- # A hack for Jim Fulton's ExtensionClass, now deprecated
- warnings.warn("__basicnew__ special case is deprecated",
- DeprecationWarning)
- value = func.__basicnew__()
- else:
- value = func(*args)
+ value = func(*args)
stack[-1] = value
dispatch[REDUCE] = load_reduce