diff options
Diffstat (limited to 'sphinx/util/pycompat.py')
-rw-r--r-- | sphinx/util/pycompat.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py index e9dec7736..69a4351bf 100644 --- a/sphinx/util/pycompat.py +++ b/sphinx/util/pycompat.py @@ -135,6 +135,10 @@ def execfile_(filepath, _globals, open=open): with open(filepath, mode) as f: source = f.read() + # py26 accept only LF eol instead of CRLF + if sys.version_info[:2] == (2, 6): + source = source.replace(b'\r\n', b'\n') + # compile to a code object, handle syntax errors filepath_enc = filepath.encode(fs_encoding) try: |