Author: Armin Rigo <[email protected]>
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)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit