mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Only cover the actual IO with the IOError
https://github.com/Textualize/textual/pull/1116#discussion_r1014606445
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user