mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Fixes #13842: cannot pickle Ellipsis or NotImplemented.
Thanks for James Sanders for the bug report and the patch.
This commit is contained in:
parent
e976fc7464
commit
f3078fbee2
4 changed files with 42 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue