1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

bump min Python version to 3.7; check python version at start

This commit is contained in:
checktheroads
2019-12-30 23:00:53 -07:00
parent 7d97b9330c
commit 8d19cf159f
4 changed files with 31 additions and 3 deletions

View File

@@ -24,4 +24,22 @@ def cpu_count():
return multiprocessing.cpu_count()
def check_python():
"""Verify Python Version.
Raises:
RuntimeError: Raised if running Python version is invalid.
Returns:
{str} -- Python version
"""
import sys
from hyperglass.constants import MIN_PYTHON_VERSION
pretty_version = ".".join(tuple(str(v) for v in MIN_PYTHON_VERSION))
if sys.version_info < MIN_PYTHON_VERSION:
raise RuntimeError(f"Python {pretty_version}+ is required.")
return pretty_version
log = _logger()