X Tutup
Skip to content

Commit fe8c259

Browse files
author
christian.heimes
committed
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. git-svn-id: http://svn.python.org/projects/python/trunk@59156 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 44508e9 commit fe8c259

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Python/ast.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
struct compiling {
2020
char *c_encoding; /* source encoding */
2121
PyArena *c_arena; /* arena for allocating memeory */
22+
const char *c_filename; /* filename */
2223
};
2324

2425
static asdl_seq *seq_for_testlist(struct compiling *, const node *);
@@ -197,6 +198,7 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
197198
c.c_encoding = NULL;
198199
}
199200
c.c_arena = arena;
201+
c.c_filename = filename;
200202

201203
k = 0;
202204
switch (TYPE(n)) {
@@ -1340,7 +1342,7 @@ ast_for_atom(struct compiling *c, const node *n)
13401342
if (Py_Py3kWarningFlag) {
13411343
if (PyErr_WarnExplicit(PyExc_DeprecationWarning,
13421344
"backquote not supported in 3.x",
1343-
"<unknown>", LINENO(n),
1345+
c->c_filename, LINENO(n),
13441346
NULL, NULL)) {
13451347
return NULL;
13461348
}

0 commit comments

Comments
 (0)
X Tutup