Skip to content

Commit 9a30cc2

Browse files
committed
improved error message
1 parent 5d1902d commit 9a30cc2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/textual/_import_app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ def import_app(import_name: str) -> App:
112112
except ImportError as error:
113113
raise AppFail(str(error))
114114

115+
find_app = name or "app"
115116
try:
116-
app = getattr(module, name or "app")
117+
app = getattr(module, find_app or "app")
117118
except AttributeError:
118-
raise AppFail(f"Unable to find {name!r} in {module!r}")
119+
raise AppFail(f"Unable to find {find_app!r} in {module!r}")
119120

120121
sys.argv[:] = [import_name, *argv]
121122

0 commit comments

Comments
 (0)