Skip to content

Commit f835efb

Browse files
authored
Apply suggestions from code review
1 parent d4e971e commit f835efb

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Lib/test/test_ctypes/test_refcounts.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,9 @@ def test_finalize(self):
125125

126126
class PyObjectRestypeTest(unittest.TestCase):
127127
def test_restype_py_object_with_null_return(self):
128-
# We need a function which returns a PyObject *, and returns NULL,
129-
# without setting an exception.
130-
# PyErr_Occurred is one such function (when no exception is set).
128+
# Test that a function which returns a NULL PyObject *
129+
# without setting an exception does not crash.
131130
PyErr_Occurred = ctypes.pythonapi.PyErr_Occurred
132-
133131
PyErr_Occurred.argtypes = []
134132
PyErr_Occurred.restype = ctypes.py_object
135133

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Fix a ``NULL`` pointer dereference when a C function called using
2-
:py:mod:`ctypes` with ``restype`` :py:obj:`~ctypes.py_object` returns
2+
:mod:`ctypes` with ``restype`` :class:`~ctypes.py_object` returns
33
``NULL``.

0 commit comments

Comments
 (0)