]> granicus.if.org Git - python/commitdiff
Revert rev. 59926, it breaks comtypes (I need to further examine this).
authorThomas Heller <theller@ctypes.org>
Mon, 28 Jan 2008 08:42:22 +0000 (08:42 +0000)
committerThomas Heller <theller@ctypes.org>
Mon, 28 Jan 2008 08:42:22 +0000 (08:42 +0000)
Lib/ctypes/test/test_funcptr.py
Misc/NEWS
Modules/_ctypes/_ctypes.c

index 92bf89bb603334d9b25e88238f0ec55d7da969cc..7ea873f0a4df7dd7d6e77579c9b174b32934cf52 100644 (file)
@@ -123,11 +123,5 @@ class CFuncPtrTestCase(unittest.TestCase):
         self.failUnlessEqual(strtok(None, "\n"), "c")
         self.failUnlessEqual(strtok(None, "\n"), None)
 
-    def test_NULL_funcptr(self):
-        tp = CFUNCTYPE(c_int)
-        func = tp() # NULL function pointer
-        # raise a ValueError when we try to call it
-        self.assertRaises(ValueError, func)
-
 if __name__ == '__main__':
     unittest.main()
index f892f4d1afc81ad7116dcb90f0a5c0e87a1e9374..7cdb1c4a7fc67a88c95b859332840b8c018332a0 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -217,8 +217,6 @@ Extension Modules
 
 - Fix a potential 'SystemError: NULL result without error' in _ctypes.
 
-- Prevent a segfault when a ctypes NULL function pointer is called.
-
 - Bug #1301: Bad assert in _tkinter fixed.
 
 - Patch #1114: fix curses module compilation on 64-bit AIX, & possibly
index fe772acc5ccb6a8cd219a4dcab2b7a1c160c64b5..814b85496bc4137584905e1b1e7ae18cb3d9dd7c 100644 (file)
@@ -3305,11 +3305,6 @@ CFuncPtr_call(CFuncPtrObject *self, PyObject *inargs, PyObject *kwds)
 
 
        pProc = *(void **)self->b_ptr;
-       if (pProc == NULL) {
-               PyErr_SetString(PyExc_ValueError,
-                               "attempt to call NULL function pointer");
-               return NULL;
-       }
 #ifdef MS_WIN32
        if (self->index) {
                /* It's a COM method */