mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
ISSUE #204 : Running on versions prior to 3.10 will fail, due to the use of `match` statements. Other parts of the script assume a recent Python also, and the system as a whole expects a recent version of Ubuntu. `pythonCheck.py` polls `sys.version_info` to detect the in-use version of Python. If the version is prior to 3.10, it bails out with the message "LibreQoS requires Python 3.10 or greater". This should help with outdated OS detection in general.
14 lines
408 B
Python
14 lines
408 B
Python
import os
|
|
|
|
def checkPythonVersion():
|
|
# Perform a version check
|
|
import sys
|
|
print("Running Python Version " + sys.version)
|
|
version_ok = True
|
|
if sys.version_info[0] < 3:
|
|
version_ok = False
|
|
if sys.version_info[0]==3 and sys.version_info[1] < 10:
|
|
version_ok = False
|
|
if version_ok == False:
|
|
print("LibreQoS requires Python 3.10 or greater.")
|
|
os._exit(-1) |