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

thomas.heller python-checkins at python.org
Thu Mar 16 20:56:25 CET 2006


Author: thomas.heller
Date: Thu Mar 16 20:56:24 2006
New Revision: 43086

Modified:
   python/trunk/Modules/_ctypes/_ctypes.c
Log:
Use int 0 as default defval for LCID if nothing has been supplied.


Modified: python/trunk/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/trunk/Modules/_ctypes/_ctypes.c	(original)
+++ python/trunk/Modules/_ctypes/_ctypes.c	Thu Mar 16 20:56:24 2006
@@ -2840,9 +2840,14 @@
 
 		switch (flag & (PARAMFLAG_FIN | PARAMFLAG_FOUT | PARAMFLAG_FLCID)) {
 		case PARAMFLAG_FIN | PARAMFLAG_FLCID:
-			/* ['in', 'lcid'] parameter.  Always taken from defval */
-			assert(defval);
-			Py_INCREF(defval);
+			/* ['in', 'lcid'] parameter.  Always taken from defval,
+			 if given, else the integer 0. */
+			if (defval == NULL) {
+				defval = PyInt_FromLong(0);
+				if (defval == NULL)
+					goto error;
+			} else
+				Py_INCREF(defval);
 			PyTuple_SET_ITEM(callargs, i, defval);
 			break;
 		case (PARAMFLAG_FIN | PARAMFLAG_FOUT):


More information about the Python-checkins mailing list