gh-109868: Skip deepcopy memo check for empty memo (GH-109869)

This commit is contained in:
Pieter Eendebak 2023-09-29 09:28:01 +02:00 committed by GitHub
parent 7dc2c5093e
commit 05079d93e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -121,10 +121,10 @@ def deepcopy(x, memo=None, _nil=[]):
See the module's __doc__ string for more info.
"""
d = id(x)
if memo is None:
memo = {}
d = id(x)
else:
y = memo.get(d, _nil)
if y is not _nil:
return y