diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2013-12-01 00:21:20 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2013-12-01 00:21:20 (GMT) |
commit | 3c23e7a5dcbc1972bd9e26dc26e61d856abb51f1 (patch) | |
tree | 600903588902508759b5ad8e3cbeb9d4b8329c1c /Lib/pickle.py | |
parent | 9204af42cc271690f57a4bc0d2af53201a796b51 (diff) | |
parent | 19b6fa6ebb887e498437b4ae87d6e70b92b4742b (diff) | |
download | cpython-3c23e7a5dcbc1972bd9e26dc26e61d856abb51f1.zip cpython-3c23e7a5dcbc1972bd9e26dc26e61d856abb51f1.tar.gz cpython-3c23e7a5dcbc1972bd9e26dc26e61d856abb51f1.tar.bz2 |
Issue #6477: Merge with 3.3.
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r-- | Lib/pickle.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py index cf8e2c5..c57149a 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -954,8 +954,17 @@ class _Pickler: self.memoize(obj) + def save_type(self, obj): + if obj is type(None): + return self.save_reduce(type, (None,), obj=obj) + elif obj is type(NotImplemented): + return self.save_reduce(type, (NotImplemented,), obj=obj) + elif obj is type(...): + return self.save_reduce(type, (...,), obj=obj) + return self.save_global(obj) + dispatch[FunctionType] = save_global - dispatch[type] = save_global + dispatch[type] = save_type # Unpickling machinery |