@@ -252,9 +252,7 @@ def get_diagnostics(
252
252
# mypy exists on path
253
253
# -> use mypy on path
254
254
log .info ("executing mypy args = %s on path" , args )
255
- completed_process = subprocess .run (
256
- ["mypy" , * args ], stdout = subprocess .PIPE , stderr = subprocess .PIPE , ** windows_flag
257
- )
255
+ completed_process = subprocess .run (["mypy" , * args ], capture_output = True , ** windows_flag )
258
256
report = completed_process .stdout .decode ()
259
257
errors = completed_process .stderr .decode ()
260
258
exit_status = completed_process .returncode
@@ -275,7 +273,7 @@ def get_diagnostics(
275
273
# -> use dmypy on path
276
274
completed_process = subprocess .run (
277
275
["dmypy" , "--status-file" , dmypy_status_file , "status" ],
278
- stderr = subprocess . PIPE ,
276
+ capture_output = True ,
279
277
** windows_flag ,
280
278
)
281
279
errors = completed_process .stderr .decode ()
@@ -287,7 +285,9 @@ def get_diagnostics(
287
285
errors .strip (),
288
286
)
289
287
subprocess .run (
290
- ["dmypy" , "--status-file" , dmypy_status_file , "restart" ], ** windows_flag
288
+ ["dmypy" , "--status-file" , dmypy_status_file , "restart" ],
289
+ capture_output = True ,
290
+ ** windows_flag ,
291
291
)
292
292
else :
293
293
# dmypy does not exist on path, but must exist in the env pylsp-mypy is installed in
@@ -310,7 +310,7 @@ def get_diagnostics(
310
310
# -> use mypy on path
311
311
log .info ("dmypy run args = %s via path" , args )
312
312
completed_process = subprocess .run (
313
- ["dmypy" , * args ], stdout = subprocess . PIPE , stderr = subprocess . PIPE , ** windows_flag
313
+ ["dmypy" , * args ], capture_output = True , ** windows_flag
314
314
)
315
315
report = completed_process .stdout .decode ()
316
316
errors = completed_process .stderr .decode ()
0 commit comments