diff Python/pythonrun.c @ 36660:3c0b26113df6 legacy-trunk

Generate code to recursively copy an AST into a tree of Python objects. Expose this through compile().
author Martin v. Löwis <martin@v.loewis.de>
date Sun, 26 Feb 2006 19:42:26 +0000
parents 7fdc639bc5b4
children 2ab9270ef19a
line wrap: on
line diff
--- a/Python/pythonrun.c	Sun Feb 26 19:27:29 2006 +0000
+++ b/Python/pythonrun.c	Sun Feb 26 19:42:26 2006 +0000
@@ -1254,6 +1254,11 @@
                 PyArena_Free(arena);
 		return NULL;
         }
+	if (flags->cf_flags & PyCF_ONLY_AST) {
+		PyObject *result = PyAST_mod2obj(mod);
+		PyArena_Free(arena);
+		return result;
+	}
 	co = PyAST_Compile(mod, filename, flags, arena);
         PyArena_Free(arena);
 	return (PyObject *)co;