Commit d66e85f3 authored by Jason R. Coombs's avatar Jason R. Coombs

Use io module for Python 2 compatibility

parent 209fbc31
......@@ -37,6 +37,7 @@ import struct
import contextlib
import subprocess
import shlex
import io
from setuptools import Command
from setuptools.sandbox import run_setup
......@@ -1801,7 +1802,7 @@ def is_python(text, filename='<string>'):
def is_sh(executable):
"""Determine if the specified executable is a .sh (contains a #! line)"""
try:
with open(executable, encoding='latin-1') as fp:
with io.open(executable, encoding='latin-1') as fp:
magic = fp.read(2)
except (OSError, IOError):
return executable
......
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