File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,18 @@ def check_formatter_installed(formatter_cmds: list[str]) -> bool:
2323 for command in set (formatter_cmds ):
2424 formatter_cmd_list = shlex .split (command , posix = os .name != "nt" )
2525 formatter_cmd_list = [tmp_file .as_posix () if chunk == file_token else chunk for chunk in formatter_cmd_list ]
26- result = subprocess .run (formatter_cmd_list , capture_output = True , check = False )
26+ try :
27+ result = subprocess .run (formatter_cmd_list , capture_output = True , check = False )
28+ except (FileNotFoundError , NotADirectoryError ):
29+ return_code = False
30+ break
2731 if result .returncode :
2832 return_code = False
2933 break
3034 tmp_file .unlink (missing_ok = True )
3135 if not return_code :
32- raise logger .error (f"Error running formatter command: { command } " )
36+ msg = f"Error running formatter command: { command } "
37+ raise logger .error (msg ) # type: ignore
3338 return return_code
3439
3540
You can’t perform that action at this time.
0 commit comments