From 93f4de918ce5dfa9f29ea693a2f815282def6625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Tue, 16 May 2023 11:30:14 +0100 Subject: [PATCH] Fix circular import. --- src/textual/screen.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/textual/screen.py b/src/textual/screen.py index a16273121..09505cc53 100644 --- a/src/textual/screen.py +++ b/src/textual/screen.py @@ -28,7 +28,6 @@ from ._callback import invoke from ._compositor import Compositor, MapGeometry from ._context import visible_screen_stack from ._types import CallbackType -from .app import ScreenStackError from .binding import Binding from .css.match import match from .css.parse import parse_selectors @@ -784,6 +783,8 @@ class Screen(Generic[ScreenResultType], Widget): simply calling [`App.pop_screen`][textual.app.App.pop_screen]. """ if self is not self.app.screen: + from .app import ScreenStackError + raise ScreenStackError( f"Can't dismiss screen {self} that's not at the top of the stack." )