virtcli: Add python3 version check

Assume 3.4 is needed, we may support earlier but I doubt anyone
is going to get all the deps in place on a distro that old
This commit is contained in:
Cole Robinson 2018-03-21 18:00:38 -04:00
parent d692b6d51e
commit bd891eb380
2 changed files with 11 additions and 5 deletions

View File

@ -20,15 +20,15 @@ import distutils.dist
import distutils.log
import distutils.sysconfig
if sys.version_info.major < 3:
print("virt-manager is python3 only. Run this as ./setup.py")
sys.exit(1)
from virtcli import CLIConfig
sysprefix = distutils.sysconfig.get_config_var("prefix")
if sys.version_info.major < 3:
print("virt-manager is python3 only. Run this as ./setup.py")
sys.exit(1)
# pylint: disable=attribute-defined-outside-init
_desktop_files = [

View File

@ -9,9 +9,15 @@
Configuration variables that can be set at build time
"""
import configparser
import os
import sys
if sys.version_info.major != 3 or sys.version_info.minor < 4:
print("python 3.4 or later is required, your's is %s" %
sys.version_info)
sys.exit(1)
import configparser
_cfg = configparser.ConfigParser()
_filepath = os.path.abspath(__file__)