[pypy-commit] pypy hpy: (ronan, arigo)

arigo pypy.commits at gmail.com
Sat Nov 16 11:58:15 EST 2019


Author: Armin Rigo <arigo at tunes.org>
Branch: hpy
Changeset: r98076:30944126f7e1
Date: 2019-11-16 17:55 +0100
http://bitbucket.org/pypy/pypy/changeset/30944126f7e1/

Log:	(ronan, arigo)

	Don't call PyErr_Occurred() when its result is not needed

diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -1880,7 +1880,10 @@
         assert cpyext_glob_tid_ptr[0] == 0
         cpyext_glob_tid_ptr[0] = tid
 
-        preexist_error = PyErr_Occurred(space)
+        if convert_result and is_PyObject(RESULT_TYPE):
+            preexist_error = PyErr_Occurred(space)
+        else:
+            preexist_error = "this is not used"
         try:
             # Call the function
             result = call_external_function(func, *boxed_args)


More information about the pypy-commit mailing list