@@ -304,7 +304,6 @@ def run(
304304 command ,
305305 * ,
306306 timeout : Optional [float ] = None ,
307- debug = None ,
308307 stdin : Optional [bytes ] = None ,
309308 print_stdout : bool = True ,
310309 print_stderr : bool = True ,
@@ -324,7 +323,6 @@ def run(
324323
325324 :param array command: Command line to be run, specified as array.
326325 :param timeout: Terminate program execution after this many seconds.
327- :param boolean debug: Enable further debug messages. (deprecated)
328326 :param stdin: Optional bytestring that is passed to command stdin.
329327 :param boolean print_stdout: Pass stdout through to sys.stdout.
330328 :param boolean print_stderr: Pass stderr through to sys.stderr.
@@ -357,10 +355,6 @@ def run(
357355 else :
358356 assert sys .platform != "win32" , "stdin argument not supported on Windows"
359357 stdin_pipe = subprocess .PIPE
360- if debug is not None :
361- warnings .warn (
362- "Use of the debug parameter is deprecated" , DeprecationWarning , stacklevel = 3
363- )
364358
365359 start_time = timeit .default_timer ()
366360 if timeout is not None :
@@ -406,7 +400,6 @@ def run(
406400 stdout = _NonBlockingStreamReader (
407401 p .stdout ,
408402 output = print_stdout ,
409- debug = debug ,
410403 notify = notifier .close ,
411404 callback = callback_stdout ,
412405 )
@@ -415,25 +408,19 @@ def run(
415408 stderr = _NonBlockingStreamReader (
416409 p .stderr ,
417410 output = print_stderr ,
418- debug = debug ,
419411 notify = notifier .close ,
420412 callback = callback_stderr ,
421413 )
422414 if stdin is not None :
423415 notifyee , notifier = Pipe (False )
424416 thread_pipe_pool .append (notifyee )
425- _NonBlockingStreamWriter (
426- p .stdin , data = stdin , debug = debug , notify = notifier .close
427- )
417+ _NonBlockingStreamWriter (p .stdin , data = stdin , notify = notifier .close )
428418
429419 timeout_encountered = False
430420
431421 while (p .returncode is None ) and (
432422 (timeout is None ) or (timeit .default_timer () < max_time )
433423 ):
434- if debug and timeout is not None :
435- logger .debug ("still running (T%.2fs)" , timeit .default_timer () - max_time )
436-
437424 # wait for some time or until a stream is closed
438425 try :
439426 if thread_pipe_pool :
@@ -450,8 +437,6 @@ def run(
450437 if event :
451438 # One-shot, so remove stream and watch remaining streams
452439 thread_pipe_pool .pop (0 )
453- if debug :
454- logger .debug ("Event received from stream thread" )
455440 else :
456441 time .sleep (0.5 )
457442 except KeyboardInterrupt :
@@ -465,8 +450,7 @@ def run(
465450 if p .returncode is None :
466451 # timeout condition
467452 timeout_encountered = True
468- if debug :
469- logger .debug ("timeout (T%.2fs)" , timeit .default_timer () - max_time )
453+ logger .debug ("timeout (T%.2fs)" , timeit .default_timer () - max_time )
470454
471455 # send terminate signal and wait some time for buffers to be read
472456 p .terminate ()
0 commit comments