diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2011-11-22 20:51:55 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2011-11-22 20:51:55 (GMT) |
commit | 58e8761da6d11653288b76d2dec6417000a20e74 (patch) | |
tree | 6b4ef5c1a8ca1329724cffe07ff34fb5282ba845 /Parser/asdl_c.py | |
parent | 3b1acf11e98bceec44c28d9e6d665e68227d8bf2 (diff) | |
download | cpython-58e8761da6d11653288b76d2dec6417000a20e74.zip cpython-58e8761da6d11653288b76d2dec6417000a20e74.tar.gz cpython-58e8761da6d11653288b76d2dec6417000a20e74.tar.bz2 |
Issue #13436: Fix a bogus error message when an AST object was passed
an invalid integer value.
Diffstat (limited to 'Parser/asdl_c.py')
-rwxr-xr-x | Parser/asdl_c.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 249e18d..b85c07e 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -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; } |