Skip to content

Commit 8364e75

Browse files
committed
Add python version check
1 parent 8caa77e commit 8364e75

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/config_editor/app.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import argparse
2727
import os
2828
import platform
29+
import sys
2930

3031
from pathlib import Path
3132

@@ -35,7 +36,7 @@
3536
from textual.widgets import Button, Header, Label
3637
except ImportError:
3738
print("Please install the \"textual-dev\" package before running this script.")
38-
quit()
39+
quit(1)
3940

4041
from settings import SettingsScreen
4142
from editor import EditorScreen
@@ -96,6 +97,7 @@ def on_mount(self) -> None:
9697
# Event handler called when the app is mounted for the first time
9798
self.title = "Configurator"
9899
self.sub_title = "Main Menu"
100+
print("Using Python version: " + sys.version)
99101
print("App started. Initial Options:")
100102
print("Root path: " + self.ROOT_PATH)
101103
print("Script path: " + self.SCRIPT_PATH)
@@ -119,6 +121,11 @@ def main() -> None:
119121
# Set the PYTHONUNBUFFERED environment variable to "1" to disable the output buffering
120122
os.environ['PYTHONUNBUFFERED'] = "1"
121123

124+
# Check Python version
125+
if sys.version_info < (3, 9):
126+
print("This script requires Python 3.9 or later")
127+
quit(1)
128+
122129
app = ConfigEditorApp()
123130

124131
parser = argparse.ArgumentParser(description="Configure and compile the ESP32 Arduino static libraries")

0 commit comments

Comments
 (0)