Skip to content

Commit

Permalink
[bindings] Adapt python2 for setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeor committed Jun 18, 2023
1 parent 72a87be commit 4d42356
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -216,7 +220,7 @@ def run(self):
author_email='[email protected]',
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=[
Expand Down

0 comments on commit 4d42356

Please sign in to comment.