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 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,8 @@ Typical usage::
|
|||||||
presets = parse_modlist_dir("modlist_html")
|
presets = parse_modlist_dir("modlist_html")
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import sys
|
|||||||
|
|
||||||
# Must not import arma_modlist_tools here — that's what we're checking FOR.
|
# 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"]
|
REQUIRED_PACKAGES = ["requests", "tqdm"]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ Usage:
|
|||||||
python update_mods.py --force --group shared # force-update one group
|
python update_mods.py --force --group shared # force-update one group
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user