1 diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
2 index 4ae2c41..ebd9960 100644
3 --- a/Modules/_ctypes/_ctypes.c
4 +++ b/Modules/_ctypes/_ctypes.c
5 @@ -602,10 +602,16 @@ CDataType_in_dll(PyObject *type, PyObject *args)
7 /* dlerror() isn't very helpful on cygwin */
8 PyErr_Format(PyExc_ValueError,
9 - "symbol '%s' not found (%s) ",
10 + "symbol '%s' not found",
13 - PyErr_SetString(PyExc_ValueError, ctypes_dlerror());
14 + const char *err = ctypes_dlerror();
16 + PyErr_Format(PyExc_ValueError,
17 + "symbol '%s' not found",
20 + PyErr_SetString(PyExc_ValueError, err);
24 @@ -3343,10 +3349,16 @@ PyCFuncPtr_FromDll(PyTypeObject *type, PyObject *args, PyObject *kwds)
26 /* dlerror() isn't very helpful on cygwin */
27 PyErr_Format(PyExc_AttributeError,
28 - "function '%s' not found (%s) ",
29 + "function '%s' not found",
32 - PyErr_SetString(PyExc_AttributeError, ctypes_dlerror());
33 + const char *err = ctypes_dlerror();
35 + PyErr_Format(PyExc_AttributeError,
36 + "function '%s' not found",
39 + PyErr_SetString(PyExc_AttributeError, err);