diff Python/Python-ast.c @ 54743:40c8c35492f1 legacy-trunk

when no module is given in a 'from' relative import, make ImportFrom.module NULL
author Benjamin Peterson <benjamin@python.org>
date Sat, 13 Jun 2009 20:23:33 +0000
parents 2e38ca709b1d
children 247f8d268d58
line wrap: on
line diff
--- a/Python/Python-ast.c	Sat Jun 13 17:08:53 2009 +0000
+++ b/Python/Python-ast.c	Sat Jun 13 20:23:33 2009 +0000
@@ -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;