diff Python/ast.c @ 43997:17479a09ec7c legacy-trunk

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.
author Christian Heimes <christian@cheimes.de>
date Sat, 24 Nov 2007 01:36:02 +0000
parents 2230f16e402b
children db5e01c33eb7
line wrap: on
line diff
--- a/Python/ast.c	Fri Nov 23 18:14:50 2007 +0000
+++ b/Python/ast.c	Sat Nov 24 01:36:02 2007 +0000
@@ -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;
             }