Skip to content
Snippets Groups Projects
Commit 5afcd743 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

bugfix for call_and_return_stdout

parent 20eda08d
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,9 @@ def call_and_return_stdout(args: tp.Union[str, tp.List[str]], ...@@ -27,7 +27,9 @@ def call_and_return_stdout(args: tp.Union[str, tp.List[str]],
Everything in kwargs will be passed to subprocess.Popen Everything in kwargs will be passed to subprocess.Popen
A bytes object will be returned if encoding is not defined, else stdout will be decoded A bytes object will be returned if encoding is not defined, else stdout will be decoded
according to specified encoding according to specified encoding.
#todo every usage of this call will spawn a daemonic thread, pending a fix
:param args: arguments to run the program with. If passed a string, it will be split on space. :param args: arguments to run the program with. If passed a string, it will be split on space.
:param timeout: amount of seconds to wait for the process result. If process does not complete :param timeout: amount of seconds to wait for the process result. If process does not complete
...@@ -52,7 +54,6 @@ def call_and_return_stdout(args: tp.Union[str, tp.List[str]], ...@@ -52,7 +54,6 @@ def call_and_return_stdout(args: tp.Union[str, tp.List[str]],
except subprocess.TimeoutExpired: except subprocess.TimeoutExpired:
proc.kill() proc.kill()
proc.wait() proc.wait()
reader_thread.join()
if proc.returncode != expected_return_code: if proc.returncode != expected_return_code:
raise ProcessFailed(proc.returncode) raise ProcessFailed(proc.returncode)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment