From 7180ecc9e36255d658eb9bfd160f1339fa2d67d3 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Tue, 20 Aug 2024 06:26:53 -0400 Subject: [PATCH] Remove dead code --- src/textual/app.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/textual/app.py b/src/textual/app.py index 216062db7f..255abc6cf9 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -658,12 +658,6 @@ def __init_subclass__(cls, *args, **kwargs) -> None: ("MODES", cls.MODES), ): for screen_name, screen_object in screen_collection.items(): - if not isinstance(screen_name, str): - # Sanity check - raise TypeError( - f"expected a string for the name in {variable_name}, got {screen_name!r}", - ) - if not (isinstance(screen_object, str) or callable(screen_object)): if isinstance(screen_object, Screen): raise ValueError( @@ -2865,13 +2859,6 @@ async def _close_all(self) -> None: await self._prune(stack_screen) stack.clear() - # Close pre-defined screens. - for screen in self.SCREENS.values(): - # This is now dead code, since instances cannot be in SCREENS. - assert not isinstance( - screen, Screen - ), "instances in SCREENS are no longer possible" - # Close any remaining nodes # Should be empty by now remaining_nodes = list(self._registry)