Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroIntensity authored Aug 20, 2024
1 parent e24b06d commit 7180ecc
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7180ecc

Please sign in to comment.