diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-21 14:36:38 +0100 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-21 14:36:38 +0100 |
commit | 32ba6930fa97bbeac9392cac3ed49aac87fd1018 (patch) | |
tree | f17282b5475a19531e48c13cf66dbb7aa197e773 /pkg_resources.py | |
parent | 6e67978d8e96d4e60462389ec71bfd2d51ac9109 (diff) | |
download | external_python_setuptools-32ba6930fa97bbeac9392cac3ed49aac87fd1018.tar.gz external_python_setuptools-32ba6930fa97bbeac9392cac3ed49aac87fd1018.tar.bz2 external_python_setuptools-32ba6930fa97bbeac9392cac3ed49aac87fd1018.zip |
Fixed execfile in pkg_resources.
--HG--
branch : distribute
extra : rebase_source : 3148f97cc98edf62e982cb14b4b90527c4fc11fb
Diffstat (limited to 'pkg_resources.py')
-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 |