[Python-checkins] cpython: Issue #22906: Do incref before SetCause/SetContext

yury.selivanov python-checkins at python.org
Sun May 10 21:10:26 CEST 2015


https://hg.python.org/cpython/rev/787cc3d1d3af
changeset: 95940:787cc3d1d3af
parent: 95935:f7cc54086cd2
user: Yury Selivanov <yselivanov at sprymix.com>
date: Sun May 10 15:09:46 2015 -0400
summary:
 Issue #22906: Do incref before SetCause/SetContext
files:
 Objects/genobject.c | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Objects/genobject.c b/Objects/genobject.c
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -149,9 +149,9 @@
 "generator raised StopIteration");
 PyErr_Fetch(&exc, &val2, &tb);
 PyErr_NormalizeException(&exc, &val2, &tb);
+ Py_INCREF(val);
 PyException_SetCause(val2, val);
 PyException_SetContext(val2, val);
- Py_INCREF(val);
 PyErr_Restore(exc, val2, tb);
 }
 }
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /