From 99120c4f7ea621ba2386c11d1300da335853dd68 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Mon, 28 Jan 2008 08:44:13 +0000 Subject: Revert rev. 59925, it breaks comtypes (I need to further examine this). --- Lib/ctypes/test/test_funcptr.py | 6 ------ Modules/_ctypes/_ctypes.c | 5 ----- 2 files changed, 11 deletions(-) diff --git a/Lib/ctypes/test/test_funcptr.py b/Lib/ctypes/test/test_funcptr.py index 92bf89b..7ea873f 100644 --- a/Lib/ctypes/test/test_funcptr.py +++ b/Lib/ctypes/test/test_funcptr.py @@ -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() diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 0f88f96..5d3cba5 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -3435,11 +3435,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 */ -- cgit v0.12