diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-11-30 17:35:40 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-11-30 17:35:40 +0200 |
commit | b63015b01a07c535ef4c26fe0bc4c336295dd08e (patch) | |
tree | fb928a9e06f9d272f98c5d16dc594332dc8e6621 /Lib/copy.py | |
parent | Issue #25761: Added more test cases for testing unpickling broken data. (diff) | |
parent | Issue #25718: Fixed copying object with state with boolean value is false. (diff) | |
download | cpython-b63015b01a07c535ef4c26fe0bc4c336295dd08e.tar.gz cpython-b63015b01a07c535ef4c26fe0bc4c336295dd08e.tar.bz2 cpython-b63015b01a07c535ef4c26fe0bc4c336295dd08e.zip |
Issue #25718: Fixed copying object with state with boolean value is false.
Diffstat (limited to 'Lib/copy.py')
-rw-r--r-- | Lib/copy.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/copy.py b/Lib/copy.py index 3a45fdf49b2..493c487d8a8 100644 --- a/Lib/copy.py +++ b/Lib/copy.py @@ -279,7 +279,7 @@ def _reconstruct(x, info, deep, memo=None): if n > 2: state = info[2] else: - state = {} + state = None if n > 3: listiter = info[3] else: @@ -293,7 +293,7 @@ def _reconstruct(x, info, deep, memo=None): y = callable(*args) memo[id(x)] = y - if state: + if state is not None: if deep: state = deepcopy(state, memo) if hasattr(y, '__setstate__'): |