summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
authorŁukasz Langa <lukasz@langa.pl>2012-03-12 18:46:12 (GMT)
committerŁukasz Langa <lukasz@langa.pl>2012-03-12 18:46:12 (GMT)
commitf3078fbee2b6555f0f5b1819a231f4b7d8bdf6b5 (patch)
treee1948498519d1e9e3d5cb91493ec9d6928268425 /Lib/pickle.py
parente976fc74647f679519edde2a1e0b73ff711e079b (diff)
downloadcpython-f3078fbee2b6555f0f5b1819a231f4b7d8bdf6b5.zip
cpython-f3078fbee2b6555f0f5b1819a231f4b7d8bdf6b5.tar.gz
cpython-f3078fbee2b6555f0f5b1819a231f4b7d8bdf6b5.tar.bz2
Fixes #13842: cannot pickle Ellipsis or NotImplemented.
Thanks for James Sanders for the bug report and the patch.
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 20b3646..9e65368 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -438,6 +438,14 @@ class _Pickler:
self.write(NONE)
dispatch[type(None)] = save_none
+ def save_ellipsis(self, obj):
+ self.save_global(Ellipsis, 'Ellipsis')
+ dispatch[type(Ellipsis)] = save_ellipsis
+
+ def save_notimplemented(self, obj):
+ self.save_global(NotImplemented, 'NotImplemented')
+ dispatch[type(NotImplemented)] = save_notimplemented
+
def save_bool(self, obj):
if self.proto >= 2:
self.write(obj and NEWTRUE or NEWFALSE)