Kaydet (Commit) 9c9a07c9 authored tarafından Guido van Rossum's avatar Guido van Rossum

Remember source filename as <module>.__file__.

üst 63e39ae9
......@@ -161,6 +161,9 @@ exec_code_module(name, co)
if (dictinsert(d, "__builtins__", getbuiltins()) != 0)
return NULL;
}
/* Remember the filename as the __file__ attribute */
if (dictinsert(d, "__file__", ((codeobject *)co)->co_filename) != 0)
err_clear(); /* Not important enough to report */
v = eval_code((codeobject *)co, d, d); /* XXX owner? */
if (v == NULL)
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment