Imports in an exec'd function get added to the the third argument
that you pass into exec, but when it looks for global variables
it looks in the second argument. So if you pass the same dict to
both arguments, then imported things will get added to the same place
that it looks for the imported modules in, so the extra global
are no longer needed.
Imports in an exec'd function get added to the the third argument that you pass into exec, but when it looks for global variables it looks in the second argument. So if you pass the same dict to both arguments, then imported things will get added to the same place that it looks for the imported modules in, so the extra
global
are no longer needed.