summaryrefslogtreecommitdiffstats
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-13 20:23:33 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-06-13 20:23:33 (GMT)
commita72be3b325ef207fdf16cdae1cdd9b0f3e349efd (patch)
tree31243e5321cf56d4d933942a8d4f9945c182f706 /Python/Python-ast.c
parent52c4bec76bdcb962e883eac1e55f98df488b558c (diff)
downloadcpython-a72be3b325ef207fdf16cdae1cdd9b0f3e349efd.zip
cpython-a72be3b325ef207fdf16cdae1cdd9b0f3e349efd.tar.gz
cpython-a72be3b325ef207fdf16cdae1cdd9b0f3e349efd.tar.bz2
when no module is given in a 'from' relative import, make ImportFrom.module NULL
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r--Python/Python-ast.c8
1 files changed, 1 insertions, 7 deletions
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 @@ 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;