diff --git a/src/textual/_import_app.py b/src/textual/_import_app.py index d60ff3b08..9425a7930 100644 --- a/src/textual/_import_app.py +++ b/src/textual/_import_app.py @@ -28,9 +28,9 @@ def shebang_python(candidate: Path) -> bool: try: with candidate.open("rb") as source: first_line = source.readline() - return first_line.startswith(b"#!") and b"python" in first_line except IOError: return False + return first_line.startswith(b"#!") and b"python" in first_line def import_app(import_name: str) -> App: