From a486054b24658fa623e030ddd4cc0cbfcac54ab0 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 19 Feb 2021 15:08:54 +0100 Subject: bpo-43270: Remove private _PyErr_OCCURRED() macro (GH-24579) Remove the private _PyErr_OCCURRED() macro: use the public PyErr_Occurred() function instead. CPython internals must use the internal _PyErr_Occurred(tstate) function instead: it is the most efficient way to check if an exception was raised. --- Python/ceval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/ceval.c') diff --git a/Python/ceval.c b/Python/ceval.c index 81a21c9a0f..4771a516a9 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2750,7 +2750,7 @@ main_loop: (PyDictObject *)f->f_builtins, name); if (v == NULL) { - if (!_PyErr_OCCURRED()) { + if (!_PyErr_Occurred(tstate)) { /* _PyDict_LoadGlobal() returns NULL without raising * an exception if the key doesn't exist */ format_exc_check_arg(tstate, PyExc_NameError, -- cgit v1.2.1