Issue #13436: Fix a bogus error message when an AST object was passed

an invalid integer value.
This commit is contained in:
Amaury Forgeot d'Arc 2011-11-22 21:51:55 +01:00
parent 3b1acf11e9
commit 58e8761da6
3 changed files with 15 additions and 5 deletions

View file

@ -816,11 +816,7 @@ static int obj2ast_int(PyObject* obj, int* out, PyArena* arena)
{
int i;
if (!PyLong_Check(obj)) {
PyObject *s = PyObject_Repr(obj);
if (s == NULL) return 1;
PyErr_Format(PyExc_ValueError, "invalid integer value: %.400s",
PyBytes_AS_STRING(s));
Py_DECREF(s);
PyErr_Format(PyExc_ValueError, "invalid integer value: %R", obj);
return 1;
}