.kill() a process when it times out
This commit is contained in:
parent
3016916087
commit
fa336d6023
1 changed files with 2 additions and 2 deletions
|
@ -51,8 +51,8 @@ class Module(object):
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
try:
|
try:
|
||||||
proc.wait(5)
|
proc.wait(5)
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired as e:
|
||||||
# execution of script expired
|
proc.kill()
|
||||||
return
|
return
|
||||||
|
|
||||||
out = proc.stdout.read().decode("utf8").strip("\n")
|
out = proc.stdout.read().decode("utf8").strip("\n")
|
||||||
|
|
Loading…
Reference in a new issue