Skip to content

Commit 734defb

Browse files
authored
mkbuildoptglobals.py: assert python version (#8886)
Fix unused var causing warnings Assert minimal supported version of python3 Python 3.7 in documentation
1 parent 84a59aa commit 734defb

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Diff for: doc/installing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Prerequisites
4444

4545
- Arduino 1.6.8 (or newer, current working version is 1.8.5)
4646
- git
47-
- Python 3.x (https://python.org)
47+
- Python ≥3.7 (https://python.org)
4848
- terminal, console, or command prompt (depending on your OS)
4949
- Internet connection
5050
- Uninstalling any core version installed via Board Manager

Diff for: tools/mkbuildoptglobals.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,24 @@
183183
"""
184184

185185
import argparse
186-
from shutil import copyfile
187186
import glob
187+
import locale
188188
import os
189189
import platform
190-
import traceback
191190
import sys
192191
import textwrap
193192
import time
193+
import traceback
194+
195+
from shutil import copyfile
196+
197+
198+
# Stay in sync with our bundled version
199+
PYTHON_REQUIRES = (3, 7)
200+
201+
if sys.version_info < PYTHON_REQUIRES:
202+
raise SystemExit(f"{__file__}\nMinimal supported version of Python is {PYTHON_REQUIRES[0]}.{PYTHON_REQUIRES[1]}")
194203

195-
import locale
196204

197205
# Need to work on signature line used for match to avoid conflicts with
198206
# existing embedded documentation methods.
@@ -682,8 +690,6 @@ def main():
682690
if debug_enabled:
683691
locale_dbg()
684692

685-
default_locale = locale.getdefaultlocale()
686-
print_msg(f'default locale: {default_locale}')
687693
print_msg(f'default_encoding: {default_encoding}')
688694

689695
print_dbg(f"runtime_ide_path: {runtime_ide_path}")

0 commit comments

Comments
 (0)