diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 021c912c2e..9c9249c787 100755 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -13,6 +13,10 @@ from distutils.command.sdist import sdist from setuptools.command.bdist_egg import bdist_egg +PYTHON2 = sys.version_info[0] == 2 +if PYTHON2: + import io + SYSTEM = sys.platform # adapted from commit e504b81 of Nguyen Tan Cong @@ -216,7 +220,7 @@ def run(self): author_email='aquynh@gmail.com', description='Capstone disassembly engine', url='https://www.capstone-engine.org', - long_description=open('README.txt', encoding="utf8").read(), + long_description=io.open('README.txt', encoding="utf8").read() if PYTHON2 else open('README.txt', encoding="utf8").read(), long_description_content_type='text/markdown', python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers=[