diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-08-01 15:36:08 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-08-01 15:36:08 -0400 |
commit | 59e3528c710363e167e0860aab4fd1a611cc058b (patch) | |
tree | e3d2b3b4ae943da59c67cc4c7090c519771cdffa /setuptools/sandbox.py | |
parent | 249e5853496ec108dc78e58c003bf46315b50ffc (diff) | |
download | external_python_setuptools-59e3528c710363e167e0860aab4fd1a611cc058b.tar.gz external_python_setuptools-59e3528c710363e167e0860aab4fd1a611cc058b.tar.bz2 external_python_setuptools-59e3528c710363e167e0860aab4fd1a611cc058b.zip |
Correct execfile implementation for Python 2.6. Fixes #236.
Diffstat (limited to 'setuptools/sandbox.py')
-rwxr-xr-x | setuptools/sandbox.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index a0d3dc61..e79a13a8 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -31,6 +31,10 @@ def _execfile(filename, globals, locals=None): Python 3 implementation of execfile. """ mode = 'rb' + # Python 2.6 compile requires LF for newlines, so use deprecated + # Universal newlines support. + if sys.version_info < (2, 7): + mode += 'U' with open(filename, mode) as stream: script = stream.read() if locals is None: |