Skip to content

bpo-38823: Fix refleaks in _ctypes extension init - #23247

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:_ctypes_init
Nov 12, 2020
Merged

vstinner merged 1 commit into
python:masterfrom
vstinner:_ctypes_init

Conversation

@vstinner

@vstinner vstinner commented Nov 12, 2020 •

Copy link
Copy Markdown
Member

Fix reference leaks in the error path of the initialization function
the _ctypes extension module: call Py_DECREF(mod) on error.

Change PyCFuncPtr_Type name from _ctypes.PyCFuncPtr to
_ctypes.CFuncPtr to be consistent with the name exposed in the
_ctypes namespace (_ctypes.CFuncPtr).

Split PyInit__ctypes() function into sub-functions and add macros for
readability.

https://bugs.python.org/issue38823

Fix reference leaks in the error path of the initialization function
the _ctypes extension module: call Py_DECREF(mod) on error.

Change PyCFuncPtr_Type name from _ctypes.PyCFuncPtr to
_ctypes.CFuncPtr to be consistent with the name exposed in the
_ctypes namespace (_ctypes.CFuncPtr).

Split PyInit__ctypes() function into sub-functions and add macros for
readability.
@vstinner
vstinner merged commit d19fa7a into python:master Nov 12, 2020
@vstinner
vstinner deleted the _ctypes_init branch November 12, 2020 13:10
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Fix reference leaks in the error path of the initialization function
the _ctypes extension module: call Py_DECREF(mod) on error.

Change PyCFuncPtr_Type name from _ctypes.PyCFuncPtr to
_ctypes.CFuncPtr to be consistent with the name exposed in the
_ctypes namespace (_ctypes.CFuncPtr).

Split PyInit__ctypes() function into sub-functions and add macros for
readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants