[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset a486054b24658fa623e030ddd4cc0cbfcac54ab0 by Victor Stinner in branch 'master': bpo-43270: Remove private _PyErr_OCCURRED() macro (GH-24579) https://github.com/python/cpython/commit/a486054b24658fa623e030ddd4cc0cbfcac54ab0 -- _

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: _PyErr_Occurred() is defined as: static inline PyObject* _PyErr_Occurred(PyThreadState *tstate) { assert(tstate != NULL); return tstate->curexc_type; } -- ___ Python tracker

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +23358 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24579 ___ Python tracker ___ _

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: > #define _PyErr_OCCURRED() (PyThreadState_GET()->curexc_type) But this way, this macro access directly the PyThreadState.curexc_type member which goes against the bpo-39947 "[C API] Make the PyThreadState structure opaque (move it to the internal C API)" is

[issue43270] [C API] Remove _PyErr_OCCURRED() macro

2021-02-19 Thread STINNER Victor
New submission from STINNER Victor : The private _PyErr_OCCURRED() function was introduced to optimize Objects/setobject.c: commit 5ba0cbe39221ff8985ce5a4702a3b01a17ae3248 Author: Raymond Hettinger Date: Sat Aug 6 18:31:24 2005 + * set_new() doesn't need to zero the structure a sec