Add an inline annotation to avoid a crash with mypy 1.15.0 (#3434)

The annotation prevents intermittent crashes when running mypy
with a clean cache:

./archinstall/tui/curses_menu.py:723: error: INTERNAL ERROR

RuntimeError: Partial type "<partial list[?]>" cannot be checked with "issubtype()"
This commit is contained in:
correctmost 2025-05-04 17:04:18 -04:00 committed by GitHub
parent 1e2f9704c8
commit ae38e92100
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -718,7 +718,10 @@ class SelectMenu[ValueT](AbstractCurses[ValueT]):
self._interrupt_warning = reset_warning_msg
self._header = header
self._header_entries = []
# TODO: Remove the inline annotation after upgrading to mypy 1.16.0
# The inline annotation is needed to avoid a crash in 1.15.0:
# RuntimeError: Partial type "<partial list[?]>" cannot be checked with "issubtype()"
self._header_entries: list[ViewportEntry] = []
if header:
self._header_entries = self.get_header_entries(header)