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
3a811f27
Commit
3a811f27
authored
Nov 06, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #24726: Revert setting the value on the dict if
_odict_add_new_node() fails.
parents
6980be40
d5f353ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
Objects/odictobject.c
Objects/odictobject.c
+7
-1
No files found.
Objects/odictobject.c
View file @
3a811f27
...
...
@@ -1721,7 +1721,13 @@ PyODict_SetItem(PyObject *od, PyObject *key, PyObject *value) {
int
res
=
PyDict_SetItem
(
od
,
key
,
value
);
if
(
res
==
0
)
{
res
=
_odict_add_new_node
((
PyODictObject
*
)
od
,
key
);
/* XXX Revert setting the value on the dict? */
if
(
res
<
0
)
{
/* Revert setting the value on the dict */
PyObject
*
exc
,
*
val
,
*
tb
;
PyErr_Fetch
(
&
exc
,
&
val
,
&
tb
);
(
void
)
PyDict_DelItem
(
od
,
key
);
_PyErr_ChainExceptions
(
exc
,
val
,
tb
);
}
}
return
res
;
};
...
...
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