Skip to content

Commit 4f1a425

Browse files
committed
Improved python version enforcing
1 parent 5ebc20e commit 4f1a425

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

FreeRGB.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
from src import __main__
2121

2222
if __name__ == '__main__':
23-
curr_version = sys.version_info
24-
min_py = __version__.python_requires.split('.')
23+
python_version = sys.version_info[:2]
24+
python_requires = __version__.python_requires
2525
# Ensure Python installation meets requirements
26-
if curr_version >= (int(min_py[0]), int(min_py[1])):
27-
__main__.init()
28-
else:
26+
if python_version < python_requires:
2927
from src import __globals__
3028
from src.init_logging import InitLogging
3129
InitLogging(2)
3230
__globals__.logger.error(
33-
f'Your system running Python {curr_version[0]}.{curr_version[1]}'
34-
f' which is lower than the required Python {min_py[0]}.{min_py[1]}.'
31+
f'Your system running Python {python_version[0]}.{python_version[1]}'
32+
f' which is lower than the required Python {python_requires[0]}.{python_requires[1]}.'
3533
f' Please consider updating your installation.')
34+
else:
35+
__main__.init()

__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
__version__ = '0.0.1'
1818

19-
python_requires = '3.8'
19+
python_requires = (3, 8)

0 commit comments

Comments
 (0)