aboutsummaryrefslogtreecommitdiffstats
path: root/pkg_resources.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2011-06-21 14:36:38 +0100
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2011-06-21 14:36:38 +0100
commit32ba6930fa97bbeac9392cac3ed49aac87fd1018 (patch)
treef17282b5475a19531e48c13cf66dbb7aa197e773 /pkg_resources.py
parent6e67978d8e96d4e60462389ec71bfd2d51ac9109 (diff)
downloadexternal_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.py6
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