@@ -78,22 +78,22 @@ 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 :
83- subprocess .run (["perf" , "-h" ], capture_output = True )
84- except (subprocess .CalledProcessError , FileNotFoundError ):
85- print ("error: The 'perf' profiler is not installed" )
86- sys .exit (1 )
87-
88- try :
89- subprocess .run (["clang" , "--version" ], capture_output = True )
90- except (subprocess .CalledProcessError , FileNotFoundError ):
91- print ("error: The clang compiler is not installed" )
92- sys .exit (1 )
93-
94- if not os .path .isfile ("mypy_self_check.ini" ):
95- print ("error: Run this in the mypy repository root" )
96- sys .exit (1 )
81+ else : # fun fact/todo: we have to use else here, because of https://github.com/python/mypy/issues/10773
82+ try :
83+ subprocess .run (["perf" , "-h" ], capture_output = True )
84+ except (subprocess .CalledProcessError , FileNotFoundError ):
85+ print ("error: The 'perf' profiler is not installed" )
86+ sys .exit (1 )
87+
88+ try :
89+ subprocess .run (["clang" , "--version" ], capture_output = True )
90+ except (subprocess .CalledProcessError , FileNotFoundError ):
91+ print ("error: The clang compiler is not installed" )
92+ sys .exit (1 )
93+
94+ if not os .path .isfile ("mypy_self_check.ini" ):
95+ print ("error: Run this in the mypy repository root" )
96+ sys .exit (1 )
9797
9898
9999def main () -> None :
0 commit comments