Skip to content

Commit 48caadc

Browse files
committed
fix(setup): check python version
1 parent f6f0e6c commit 48caadc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import platform
22
import os
3-
import sys
43

54
from urllib.request import urlopen
65

@@ -22,8 +21,10 @@ class PostInstallCommand(install):
2221
def run(self):
2322
version_tag = 'v{}'.format(version)
2423
url_template = 'https://github.com/LeetCode-OpenSource/py-sourcemap/releases/download/{tag}/py_sourcemap.cpython-{py_ver}-{platform}.so'
25-
py_version = '{}{}m'.format(sys.version_info.major,
26-
sys.version_info.minor)
24+
(major, minor, _) = platform.python_version_tuple()
25+
if major != '3' or not(minor in ['5', '6', '7']):
26+
raise Exception('Only python 3.5, 3.6, 3.7 are supported')
27+
py_version = '{}{}m'.format(major, minor)
2728
system = platform.system()
2829
if system == 'Linux':
2930
usr_platform = 'x86_64-linux-gnu'

0 commit comments

Comments
 (0)