diff --git a/homeassistant/__main__.py b/homeassistant/__main__.py index f35e0c1c1f0..1a0419471ff 100644 --- a/homeassistant/__main__.py +++ b/homeassistant/__main__.py @@ -12,15 +12,21 @@ from multiprocessing import Process import homeassistant.config as config_util from homeassistant import bootstrap from homeassistant.const import ( - EVENT_HOMEASSISTANT_START, RESTART_EXIT_CODE, __version__) + __version__, + EVENT_HOMEASSISTANT_START, + REQUIRED_PYTHON_VER, + RESTART_EXIT_CODE, +) def validate_python(): """ Validate we're running the right Python version. """ major, minor = sys.version_info[:2] + req_major, req_minor = REQUIRED_PYTHON_VER - if major < 3 or (major == 3 and minor < 4): - print("Home Assistant requires atleast Python 3.4") + if major < req_major or (major == req_major and minor < req_minor): + print("Home Assistant requires at least Python {}.{}".format( + req_major, req_minor)) sys.exit(1) diff --git a/homeassistant/const.py b/homeassistant/const.py index c7e6db96818..88987e25a2d 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,6 +2,7 @@ """Constants used by Home Assistant components.""" __version__ = "0.15.0.dev0" +REQUIRED_PYTHON_VER = (3, 4) # Can be used to specify a catch all when registering state or event listeners. MATCH_ALL = '*'