Files
lutris/utils/check_annotations.py
Daniel Johnson 697fa22d23 Detect string literals in | union annotations (crashes Python <3.14)
`"Foo" | None` fails at runtime on Python 3.10–3.13 because str doesn't
implement __or__. This only works on 3.14+ where PEP 749 defers annotation
evaluation. Add a check for this pattern alongside the existing conditional
import check so we catch it before it reaches users.

Ref: https://github.com/lutris/lutris/pull/6595

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 07:16:30 -04:00

7.7 KiB