@@ -253,7 +253,7 @@ def get_diagnostics(
253253 # -> use mypy on path
254254 log .info ("executing mypy args = %s on path" , args )
255255 completed_process = subprocess .run (
256- ["mypy" , * args ], stdout = subprocess . PIPE , stderr = subprocess . PIPE , ** windows_flag
256+ ["mypy" , * args ], capture_output = True , ** windows_flag
257257 )
258258 report = completed_process .stdout .decode ()
259259 errors = completed_process .stderr .decode ()
@@ -275,7 +275,7 @@ def get_diagnostics(
275275 # -> use dmypy on path
276276 completed_process = subprocess .run (
277277 ["dmypy" , "--status-file" , dmypy_status_file , "status" ],
278- stderr = subprocess . PIPE ,
278+ capture_output = True ,
279279 ** windows_flag ,
280280 )
281281 errors = completed_process .stderr .decode ()
@@ -287,7 +287,9 @@ def get_diagnostics(
287287 errors .strip (),
288288 )
289289 subprocess .run (
290- ["dmypy" , "--status-file" , dmypy_status_file , "restart" ], ** windows_flag
290+ ["dmypy" , "--status-file" , dmypy_status_file , "restart" ],
291+ capture_output = True ,
292+ ** windows_flag
291293 )
292294 else :
293295 # dmypy does not exist on path, but must exist in the env pylsp-mypy is installed in
@@ -310,7 +312,7 @@ def get_diagnostics(
310312 # -> use mypy on path
311313 log .info ("dmypy run args = %s via path" , args )
312314 completed_process = subprocess .run (
313- ["dmypy" , * args ], stdout = subprocess . PIPE , stderr = subprocess . PIPE , ** windows_flag
315+ ["dmypy" , * args ], capture_output = True , ** windows_flag
314316 )
315317 report = completed_process .stdout .decode ()
316318 errors = completed_process .stderr .decode ()
0 commit comments