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
53b97712
Commit
53b97712
authored
Apr 23, 2012
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't make shared keys with dict subclasses
parent
99e6f875
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
Objects/dictobject.c
Objects/dictobject.c
+1
-1
No files found.
Objects/dictobject.c
View file @
53b97712
...
@@ -3686,7 +3686,7 @@ _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr,
...
@@ -3686,7 +3686,7 @@ _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr,
res
=
PyDict_SetItem
(
dict
,
key
,
value
);
res
=
PyDict_SetItem
(
dict
,
key
,
value
);
if
(
cached
!=
((
PyDictObject
*
)
dict
)
->
ma_keys
)
{
if
(
cached
!=
((
PyDictObject
*
)
dict
)
->
ma_keys
)
{
/* Either update tp->ht_cached_keys or delete it */
/* Either update tp->ht_cached_keys or delete it */
if
(
cached
->
dk_refcnt
==
1
)
{
if
(
cached
->
dk_refcnt
==
1
&&
PyDict_CheckExact
(
dict
)
)
{
CACHED_KEYS
(
tp
)
=
make_keys_shared
(
dict
);
CACHED_KEYS
(
tp
)
=
make_keys_shared
(
dict
);
if
(
CACHED_KEYS
(
tp
)
==
NULL
)
if
(
CACHED_KEYS
(
tp
)
==
NULL
)
return
-
1
;
return
-
1
;
...
...
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