when no module is given in a 'from' relative import, make ImportFrom.module NULL
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index 4a999d1..23cb7f3 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -1330,11 +1330,6 @@
col_offset, PyArena *arena)
{
stmt_ty p;
- if (!module) {
- PyErr_SetString(PyExc_ValueError,
- "field module is required for ImportFrom");
- return NULL;
- }
p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p));
if (!p)
return NULL;
@@ -4273,8 +4268,7 @@
Py_XDECREF(tmp);
tmp = NULL;
} else {
- PyErr_SetString(PyExc_TypeError, "required field \"module\" missing from ImportFrom");
- return 1;
+ module = NULL;
}
if (PyObject_HasAttrString(obj, "names")) {
int res;