summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-01-28 14:40:16 (GMT)
committerGuido van Rossum <guido@python.org>2003-01-28 14:40:16 (GMT)
commitcbe2dbddda7bbcf2f27ba668b86b21596c900edf (patch)
treec7807776a55124ca44b1465386d9de2bd83ccb09 /Lib/pickle.py
parent4faea015f73eb131b86e7523f9cb45854e523881 (diff)
downloadcpython-cbe2dbddda7bbcf2f27ba668b86b21596c900edf.zip
cpython-cbe2dbddda7bbcf2f27ba668b86b21596c900edf.tar.gz
cpython-cbe2dbddda7bbcf2f27ba668b86b21596c900edf.tar.bz2
Don't memoize the empty tuple in protocol 0.
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 02288d8..2baee46 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -502,7 +502,8 @@ class Pickler:
# No recursion (including the empty-tuple case for protocol 0).
self.write(TUPLE)
- self.memoize(object) # XXX shouldn't memoize empty tuple?!
+ if object: # No need to memoize empty tuple
+ self.memoize(object)
dispatch[TupleType] = save_tuple