[Python-checkins] r59156 - python/trunk/Python/ast.c

christian.heimes python-checkins at python.org
Sat Nov 24 02:36:02 CET 2007


Author: christian.heimes
Date: Sat Nov 24 02:36:02 2007
New Revision: 59156

Modified:
   python/trunk/Python/ast.c
Log:
Added filename to compiling struct based on Martin's suggestion.
I'm wonder why I was trying to add the filename to the node all the time. The compiling struct is more obvious.

Modified: python/trunk/Python/ast.c
==============================================================================
--- python/trunk/Python/ast.c	(original)
+++ python/trunk/Python/ast.c	Sat Nov 24 02:36:02 2007
@@ -19,6 +19,7 @@
 struct compiling {
     char *c_encoding; /* source encoding */
     PyArena *c_arena; /* arena for allocating memeory */
+    const char *c_filename; /* filename */
 };
 
 static asdl_seq *seq_for_testlist(struct compiling *, const node *);
@@ -197,6 +198,7 @@
         c.c_encoding = NULL;
     }
     c.c_arena = arena;
+    c.c_filename = filename;
 
     k = 0;
     switch (TYPE(n)) {
@@ -1340,7 +1342,7 @@
         if (Py_Py3kWarningFlag) {
             if (PyErr_WarnExplicit(PyExc_DeprecationWarning,
                                    "backquote not supported in 3.x",
-                                   "<unknown>", LINENO(n),
+                                   c->c_filename, LINENO(n),
                                    NULL, NULL)) {
             return NULL;
             }


More information about the Python-checkins mailing list