mirror of
https://github.com/python/cpython.git
synced 2025-09-08 18:01:44 +00:00
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
This commit is contained in:
parent
f3175f6341
commit
45aecf451a
24 changed files with 87 additions and 6365 deletions
|
@ -486,15 +486,16 @@ converterr(const char *expected, PyObject *arg, char *msgbuf, size_t bufsize)
|
|||
|
||||
#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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue