[Python-checkins] r69580 - python/trunk/Modules/_ctypes/_ctypes.c

georg.brandl python-checkins at python.org
Fri Feb 13 12:10:04 CET 2009


Author: georg.brandl
Date: Fri Feb 13 12:10:04 2009
New Revision: 69580
Log:
Fix warnings GCC emits where the argument of PyErr_Format is a single variable.
Modified:
 python/trunk/Modules/_ctypes/_ctypes.c
Modified: python/trunk/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/trunk/Modules/_ctypes/_ctypes.c	(original)
+++ python/trunk/Modules/_ctypes/_ctypes.c	Fri Feb 13 12:10:04 2009
@@ -599,13 +599,14 @@
 #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 @@
 #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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /