aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/sandbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/sandbox.py')
-rwxr-xr-xsetuptools/sandbox.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py
index 185f2573..1d23ba98 100755
--- a/setuptools/sandbox.py
+++ b/setuptools/sandbox.py
@@ -30,7 +30,12 @@ def _execfile(filename, globals, locals=None):
"""
Python 3 implementation of execfile.
"""
- with open(filename, 'rb') as stream:
+ 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:
locals = globals