]> granicus.if.org Git - python/commitdiff
Fix warnings GCC emits where the argument of PyErr_Format is a single variable.
authorGeorg Brandl <georg@python.org>
Fri, 13 Feb 2009 11:10:04 +0000 (11:10 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 13 Feb 2009 11:10:04 +0000 (11:10 +0000)
Modules/_ctypes/_ctypes.c

index a509d4b0107f9ce9f42868005a24e44315ed58fe..360046bd0da2ce3feff8837cb67f5606b3b10330 100644 (file)
@@ -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