diff options
Diffstat (limited to 'Lib/copy_reg.py')
-rw-r--r-- | Lib/copy_reg.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/copy_reg.py b/Lib/copy_reg.py index eb02864..d469744 100644 --- a/Lib/copy_reg.py +++ b/Lib/copy_reg.py @@ -54,4 +54,12 @@ def _reduce(self): state = None else: state = base(self) - return _reconstructor, (self.__class__, base, state), self.__dict__ + args = (self.__class__, base, state) + try: + dict = self.__dict__ + except AttributeError: + dict = None + if dict: + return _reconstructor, args, dict + else: + return _reconstructor, args |