Index: Python/getargs.c =================================================================== --- Python/getargs.c (revision 81858) +++ Python/getargs.c (working copy) @@ -582,19 +582,6 @@ #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. */ -static int -float_argument_warning(PyObject *arg) -{ - if (PyFloat_Check(arg) && - PyErr_Warn(PyExc_DeprecationWarning, - "integer argument expected, got float" )) - return 1; - else - return 0; -} - /* Explicitly check for float arguments when integers are expected. Return 1 for error, 0 if ok. */ static int @@ -791,14 +778,13 @@ case 'L': {/* PY_LONG_LONG */ PY_LONG_LONG *p = va_arg( *p_va, PY_LONG_LONG * ); PY_LONG_LONG ival; - if (float_argument_warning(arg)) + if (float_argument_error(arg)) return converterr("long", arg, msgbuf, bufsize); ival = PyLong_AsLongLong(arg); - if (ival == (PY_LONG_LONG)-1 && PyErr_Occurred() ) { + if (ival == (PY_LONG_LONG)-1 && PyErr_Occurred()) return converterr("long", arg, msgbuf, bufsize); - } else { + else *p = ival; - } break; } Index: Lib/test/test_getargs2.py =================================================================== --- Lib/test/test_getargs2.py (revision 81858) +++ Lib/test/test_getargs2.py (working copy) @@ -1,7 +1,6 @@ import unittest from test import support from _testcapi import getargs_keywords -import warnings """ > How about the following counterproposal. This also changes some of @@ -190,21 +189,7 @@ from _testcapi import getargs_L # L returns 'long long', and does range checking (LLONG_MIN # ... LLONG_MAX) - with warnings.catch_warnings(): - warnings.filterwarnings( - "ignore", - category=DeprecationWarning, - message=".*integer argument expected, got float", - module=__name__) - self.assertEqual(3, getargs_L(3.14)) - with warnings.catch_warnings(): - warnings.filterwarnings( - "error", - category=DeprecationWarning, - message=".*integer argument expected, got float", - module="unittest") - self.assertRaises(DeprecationWarning, getargs_L, 3.14) - + self.assertRaises(TypeError, getargs_L, 3.14) self.assertRaises(TypeError, getargs_L, "Hello") self.assertEqual(99, getargs_L(Int()))