summaryrefslogtreecommitdiffstats
path: root/Modules/_ctypes
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-02-13 11:10:04 (GMT)
committerGeorg Brandl <georg@python.org>2009-02-13 11:10:04 (GMT)
commit2c079297706e4ef6a47a80d68f6e38fddddf1728 (patch)
tree33f90513e1eff365fcb3d7db6e3e1acbe374c753 /Modules/_ctypes
parentcbb4958cd83675d49f6ee39154b3e392d2a69707 (diff)
downloadcpython-2c079297706e4ef6a47a80d68f6e38fddddf1728.zip
cpython-2c079297706e4ef6a47a80d68f6e38fddddf1728.tar.gz
cpython-2c079297706e4ef6a47a80d68f6e38fddddf1728.tar.bz2
Fix warnings GCC emits where the argument of PyErr_Format is a single variable.
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r--Modules/_ctypes/_ctypes.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index a509d4b..360046b 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -599,13 +599,14 @@ CDataType_in_dll(PyObject *type, PyObject *args)
#else
address = (void *)ctypes_dlsym(handle, name);
if (!address) {
- PyErr_Format(PyExc_ValueError,
#ifdef __CYGWIN__
/* dlerror() isn't very helpful on cygwin */
+ PyErr_Format(PyExc_ValueError,
"symbol '%s' not found (%s) ",
- name,
+ name);
+#else
+ PyErr_SetString(PyExc_ValueError, ctypes_dlerror());
#endif
- ctypes_dlerror());
return NULL;
}
#endif
@@ -3283,13 +3284,14 @@ CFuncPtr_FromDll(PyTypeObject *type, PyObject *args, PyObject *kwds)
#else
address = (PPROC)ctypes_dlsym(handle, name);
if (!address) {
- PyErr_Format(PyExc_AttributeError,
#ifdef __CYGWIN__
/* dlerror() isn't very helpful on cygwin */
+ PyErr_Format(PyExc_AttributeError,
"function '%s' not found (%s) ",
- name,
+ name);
+#else
+ PyErr_SetString(PyExc_AttributeError, ctypes_dlerror());
#endif
- ctypes_dlerror());
return NULL;
}
#endif