Issue #13436: Fix a bogus error message when an AST object was passed
an invalid integer value.
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 @@
{
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;
}