From 1d925da551c144408747fdb78fa5de49b66b08f5 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Mon, 22 May 2023 13:20:49 +0100 Subject: [PATCH] Ensure selection casting works in earlier Pythons --- src/textual/widgets/_selection_list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/textual/widgets/_selection_list.py b/src/textual/widgets/_selection_list.py index 29ede5dbe..928dcd6ca 100644 --- a/src/textual/widgets/_selection_list.py +++ b/src/textual/widgets/_selection_list.py @@ -203,11 +203,11 @@ class SelectionList(Generic[SelectionType], OptionList): """ if len(selection) == 3: label, value, selected = cast( - tuple[TextType, SelectionType, bool], selection + "tuple[TextType, SelectionType, bool]", selection ) elif len(selection) == 2: label, value, selected = cast( - tuple[TextType, SelectionType, bool], (*selection, False) + "tuple[TextType, SelectionType, bool]", (*selection, False) ) else: # TODO: Proper error.