diff Python/getargs.c @ 36988:49c6eb688906

Checkpoint. 218 tests are okay; 53 are failing. Done so far: - all classes are new-style (but ripping out classobject.[ch] isn't done) - int/int -> float - all exceptions must derive from BaseException - absolute import - 'as' and 'with' are keywords
author Guido van Rossum <guido@python.org>
date Wed, 15 Mar 2006 04:58:47 +0000
parents 64ff3b225d48
children f731859e9b3b
line wrap: on
line diff
--- a/Python/getargs.c	Tue Mar 14 22:22:15 2006 +0000
+++ b/Python/getargs.c	Wed Mar 15 04:58:47 2006 +0000
@@ -486,15 +486,16 @@
 
 #define CONV_UNICODE "(unicode conversion error)"
 
-/* explicitly check for float arguments when integers are expected.  For now
- * signal a warning.  Returns true if an exception was raised. */
+/* Explicitly check for float arguments when integers are expected.
+   Return 1 for error, 0 if ok. */
 static int
 float_argument_error(PyObject *arg)
 {
-	if (PyFloat_Check(arg) &&
-	    PyErr_Warn(PyExc_DeprecationWarning,
-		       "integer argument expected, got float" ))
+	if (PyFloat_Check(arg)) {
+		PyErr_SetString(PyExc_TypeError,
+				"integer argument expected, got float" );
 		return 1;
+	}
 	else
 		return 0;
 }