Index: Python/getargs.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v
retrieving revision 2.94
diff -u -r2.94 getargs.c
--- Python/getargs.c 21 Nov 2002 20:23:11 -0000 2.94
+++ Python/getargs.c 19 Jan 2003 19:28:45 -0000
@@ -490,7 +490,10 @@
case 'i': {/* signed int */
int *p = va_arg(*p_va, int *);
- long ival = PyInt_AsLong(arg);
+ long ival;
+ if (PyFloat_Check(arg))
+ return converterr("integer", arg, msgbuf, bufsize);
+ ival = PyInt_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
return converterr("integer", arg, msgbuf, bufsize);
else if (ival > INT_MAX) {
@@ -510,7 +513,10 @@
case 'l': {/* long int */
long *p = va_arg(*p_va, long *);
- long ival = PyInt_AsLong(arg);
+ long ival;
+ if (PyFloat_Check(arg))
+ return converterr("integer", arg, msgbuf, bufsize);
+ ival = PyInt_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
return converterr("integer