From da9e7782d604352d10179bcf5114be8dbc374702 Mon Sep 17 00:00:00 2001 From: revernomad17 Date: Tue, 7 Apr 2026 16:16:38 +0700 Subject: [PATCH] fix Python 3.9 compatibility (str | None union syntax) parser.py and update_mods.py were missing 'from __future__ import annotations', causing a TypeError on Python < 3.10 when the X | Y union syntax is evaluated at runtime. All other modules already had the import. Also lowers MIN_PYTHON from 3.11 to 3.9 -- the toolchain does not use any Python 3.10/3.11-specific stdlib features beyond the union annotation syntax which is now handled by the future import. Co-Authored-By: Claude Sonnet 4.6 --- arma_modlist_tools/parser.py | 2 ++ check_deps.py | 2 +- update_mods.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arma_modlist_tools/parser.py b/arma_modlist_tools/parser.py index 7e18617..3d3b687 100644 --- a/arma_modlist_tools/parser.py +++ b/arma_modlist_tools/parser.py @@ -15,6 +15,8 @@ Typical usage:: presets = parse_modlist_dir("modlist_html") """ +from __future__ import annotations + import re import xml.etree.ElementTree as ET from pathlib import Path diff --git a/check_deps.py b/check_deps.py index c15b5ac..3f695cb 100644 --- a/check_deps.py +++ b/check_deps.py @@ -13,7 +13,7 @@ import sys # Must not import arma_modlist_tools here — that's what we're checking FOR. -MIN_PYTHON = (3, 11) +MIN_PYTHON = (3, 9) REQUIRED_PACKAGES = ["requests", "tqdm"] diff --git a/update_mods.py b/update_mods.py index d7fa30c..70fcf67 100644 --- a/update_mods.py +++ b/update_mods.py @@ -18,6 +18,8 @@ Usage: python update_mods.py --force --group shared # force-update one group """ +from __future__ import annotations + import argparse import sys