mirror of https://github.com/python/cpython
Remember source filename as <module>.__file__.
This commit is contained in:
parent
63e39ae933
commit
9c9a07c9c9
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue