Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63e39ae commit 9c9a07cCopy full SHA for 9c9a07c
1 file changed
Python/import.c
@@ -161,6 +161,9 @@ exec_code_module(name, co)
161
if (dictinsert(d, "__builtins__", getbuiltins()) != 0)
162
return NULL;
163
}
164
+ /* Remember the filename as the __file__ attribute */
165
+ if (dictinsert(d, "__file__", ((codeobject *)co)->co_filename) != 0)
166
+ err_clear(); /* Not important enough to report */
167
v = eval_code((codeobject *)co, d, d); /* XXX owner? */
168
if (v == NULL)
169
0 commit comments