Skip to content

Commit 058f2cf

Browse files
Update profile_check.py: just use else for the platform logic
Rely on pre-commit to fix this formatting
1 parent ff78165 commit 058f2cf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

misc/profile_check.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,20 @@ def check_requirements() -> None:
7878
if sys.platform != "linux":
7979
# TODO: How to make this work on other platforms?
8080
sys.exit("error: Only Linux is supported")
81-
82-
try: # type: ignore[unreachable] # https://github.com/python/mypy/issues/10773
81+
else: # fun fact/todo: we have to use else here, because of https://github.com/python/mypy/issues/10773
82+
try:
8383
subprocess.run(["perf", "-h"], capture_output=True)
84-
except (subprocess.CalledProcessError, FileNotFoundError):
84+
except (subprocess.CalledProcessError, FileNotFoundError):
8585
print("error: The 'perf' profiler is not installed")
8686
sys.exit(1)
8787

88-
try:
88+
try:
8989
subprocess.run(["clang", "--version"], capture_output=True)
90-
except (subprocess.CalledProcessError, FileNotFoundError):
90+
except (subprocess.CalledProcessError, FileNotFoundError):
9191
print("error: The clang compiler is not installed")
9292
sys.exit(1)
9393

94-
if not os.path.isfile("mypy_self_check.ini"):
94+
if not os.path.isfile("mypy_self_check.ini"):
9595
print("error: Run this in the mypy repository root")
9696
sys.exit(1)
9797

0 commit comments

Comments
 (0)