mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00

- Fix thin dir unit tests after distro change revert - Skip any tests that require system python of 3.9 or higher
17 lines
452 B
Python
17 lines
452 B
Python
import subprocess
|
|
|
|
import packaging
|
|
|
|
|
|
def check_system_python_version():
|
|
"""
|
|
Validate the system python version is greater than 3.9
|
|
"""
|
|
try:
|
|
ret = subprocess.run(
|
|
["/usr/bin/python3", "--version"], capture_output=True, check=True
|
|
)
|
|
except FileNotFoundError:
|
|
return None
|
|
ver = ret.stdout.decode().split(" ", 1)[-1]
|
|
return packaging.version.Version(ver) >= packaging.version.Version("3.9")
|