[Python-checkins] cpython: Better assertion in PyObject_Call() to detect functions returning a result with
victor.stinner
python-checkins at python.org
Thu Dec 19 16:41:56 CET 2013
http://hg.python.org/cpython/rev/07331638ac85
changeset: 88061:07331638ac85
parent: 88057:298d98486794
user: Victor Stinner <victor.stinner at gmail.com>
date: Thu Dec 19 13:47:35 2013 +0100
summary:
Better assertion in PyObject_Call() to detect functions returning a result with
an exception set (invalid state).
files:
Objects/abstract.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Objects/abstract.c b/Objects/abstract.c
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2073,7 +2073,8 @@
"NULL result without error in PyObject_Call");
}
#else
- assert(result != NULL || PyErr_Occurred());
+ assert((result != NULL && !PyErr_Occurred())
+ || (result == NULL && PyErr_Occurred()));
#endif
return result;
}
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list