mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #25718: Fixed copying object with state with boolean value is false.
This commit is contained in:
commit
b63015b01a
3 changed files with 13 additions and 2 deletions
|
@ -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__'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue