mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Issue #13436: Fix a bogus error message when an AST object was passed
an invalid integer value.
This commit is contained in:
parent
3b1acf11e9
commit
58e8761da6
3 changed files with 15 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue