add a asdl bytes type, so Bytes.s be properly typechecked
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 432d7b7..0b95aaa 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -776,6 +776,7 @@
}
#define ast2obj_identifier ast2obj_object
#define ast2obj_string ast2obj_object
+#define ast2obj_bytes ast2obj_object
static PyObject* ast2obj_int(long b)
{
@@ -813,6 +814,15 @@
return obj2ast_object(obj, out, arena);
}
+static int obj2ast_bytes(PyObject* obj, PyObject** out, PyArena* arena)
+{
+ if (!PyBytes_CheckExact(obj)) {
+ PyErr_SetString(PyExc_TypeError, "AST bytes must be of type bytes");
+ return 1;
+ }
+ return obj2ast_object(obj, out, arena);
+}
+
static int obj2ast_int(PyObject* obj, int* out, PyArena* arena)
{
int i;