diff options
-rw-r--r-- | pkg_resources.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index f64745cb..ae1f6c4d 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -41,7 +41,11 @@ except NameError: basestring = str from io import StringIO exec_ = eval("exec") - def execfile(fn, globs, locs): + def execfile(fn, globs=None, locs=None): + if globs is None: + globs = globals() + if locs is None: + locs = globs exec_(compile(open(fn).read(), fn, 'exec'), globs, locs) # capture these to bypass sandboxing |