|
|
|
@ -1191,7 +1191,8 @@ class PartingShots(StaticVisitor): |
|
|
|
CODE = """ |
|
|
|
PyObject* PyAST_mod2obj(mod_ty t) |
|
|
|
{ |
|
|
|
init_types(); |
|
|
|
if (!init_types()) |
|
|
|
return NULL; |
|
|
|
return ast2obj_mod(t); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1205,7 +1206,8 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) |
|
|
|
int isinstance; |
|
|
|
assert(0 <= mode && mode <= 2); |
|
|
|
|
|
|
|
init_types(); |
|
|
|
if (!init_types()) |
|
|
|
return NULL; |
|
|
|
|
|
|
|
isinstance = PyObject_IsInstance(ast, req_type[mode]); |
|
|
|
if (isinstance == -1) |
|
|
|
@ -1223,7 +1225,8 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) |
|
|
|
|
|
|
|
int PyAST_Check(PyObject* obj) |
|
|
|
{ |
|
|
|
init_types(); |
|
|
|
if (!init_types()) |
|
|
|
return -1; |
|
|
|
return PyObject_IsInstance(obj, (PyObject*)&AST_type); |
|
|
|
} |
|
|
|
""" |
|
|
|
|