aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/sandbox.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-08-01 15:36:08 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-08-01 15:36:08 -0400
commit59e3528c710363e167e0860aab4fd1a611cc058b (patch)
treee3d2b3b4ae943da59c67cc4c7090c519771cdffa /setuptools/sandbox.py
parent249e5853496ec108dc78e58c003bf46315b50ffc (diff)
downloadexternal_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-xsetuptools/sandbox.py4
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: