From a72be3b325ef207fdf16cdae1cdd9b0f3e349efd Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 13 Jun 2009 20:23:33 +0000 Subject: when no module is given in a 'from' relative import, make ImportFrom.module NULL --- Python/Python-ast.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'Python/Python-ast.c') diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 4a999d12f4..23cb7f35be 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -1330,11 +1330,6 @@ ImportFrom(identifier module, asdl_seq * names, int level, int lineno, int 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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) 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; -- cgit v1.2.1