diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2013-11-30 16:21:20 -0800 |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2013-11-30 16:21:20 -0800 |
commit | fc560da0bb302e08f33e96cc98c78aee06beb075 (patch) | |
tree | f9ba254dea95146554f561358e5c32b0007cb6d8 /Lib/pickle.py | |
parent | 33560daf5a0781083dbce0a1b3d3684ff8320fa8 (diff) | |
parent | 6d546f6921dc6841de58c72360d02477c0dddf50 (diff) | |
download | cpython-fc560da0bb302e08f33e96cc98c78aee06beb075.tar.gz |
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 cf8e2c5964..c57149a393 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 |