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
diff --git a/Python/getargs.c b/Python/getargs.c
index 8ee7d2f..fac0b6f 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -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;
}