Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
61154600
Commit
61154600
authored
Aug 12, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure that *any* object whose id() is used as a memo key is kept
alive in the memo. This fixes SF bug 592567.
parent
547607c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
Lib/copy.py
Lib/copy.py
+1
-2
No files found.
Lib/copy.py
View file @
61154600
...
...
@@ -185,6 +185,7 @@ def deepcopy(x, memo = None):
else
:
y
=
copierfunction
(
x
,
memo
)
memo
[
d
]
=
y
_keep_alive
(
x
,
memo
)
# Make sure x lives at least as long as d
return
y
_deepcopy_dispatch
=
d
=
{}
...
...
@@ -269,7 +270,6 @@ def _deepcopy_inst(x, memo):
return
x
.
__deepcopy__
(
memo
)
if
hasattr
(
x
,
'__getinitargs__'
):
args
=
x
.
__getinitargs__
()
_keep_alive
(
args
,
memo
)
args
=
deepcopy
(
args
,
memo
)
y
=
apply
(
x
.
__class__
,
args
)
else
:
...
...
@@ -278,7 +278,6 @@ def _deepcopy_inst(x, memo):
memo
[
id
(
x
)]
=
y
if
hasattr
(
x
,
'__getstate__'
):
state
=
x
.
__getstate__
()
_keep_alive
(
state
,
memo
)
else
:
state
=
x
.
__dict__
state
=
deepcopy
(
state
,
memo
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment