Commit 59e3528c authored by Jason R. Coombs's avatar Jason R. Coombs

Correct execfile implementation for Python 2.6. Fixes #236.

parent 249e5853
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
CHANGES CHANGES
======= =======
-----
5.4.2
-----
* Issue #236: Corrected regression in execfile implementation for Python 2.6.
----- -----
5.4.1 5.4.1
----- -----
......
[console_scripts] [console_scripts]
easy_install = setuptools.command.easy_install:main easy_install = setuptools.command.easy_install:main
easy_install-2.6 = setuptools.command.easy_install:main easy_install-3.4 = setuptools.command.easy_install:main
[distutils.commands] [distutils.commands]
alias = setuptools.command.alias:alias alias = setuptools.command.alias:alias
......
...@@ -31,6 +31,10 @@ def _execfile(filename, globals, locals=None): ...@@ -31,6 +31,10 @@ def _execfile(filename, globals, locals=None):
Python 3 implementation of execfile. Python 3 implementation of execfile.
""" """
mode = 'rb' 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: with open(filename, mode) as stream:
script = stream.read() script = stream.read()
if locals is None: if locals is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment