aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-07-01 12:54:27 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-07-01 12:54:27 -0400
commit453e36867eb79ec1989f241caf15552c04b49de4 (patch)
treea11823691c0e4dedf9617c2e99dccb2860ce12f7 /grs/Execute.py
parentClean up makedirs(). (diff)
downloadgrss-453e36867eb79ec1989f241caf15552c04b49de4.tar.gz
grss-453e36867eb79ec1989f241caf15552c04b49de4.tar.bz2
grss-453e36867eb79ec1989f241caf15552c04b49de4.zip
Clean up more exceptions.
Diffstat (limited to 'grs/Execute.py')
-rw-r--r--grs/Execute.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/grs/Execute.py b/grs/Execute.py
index 533d269..15fe562 100644
--- a/grs/Execute.py
+++ b/grs/Execute.py
@@ -19,17 +19,17 @@ class Execute():
pid = os.getpid()
f.write('SENDING SIGTERM to pid = %d\n' % pid)
f.close()
- os.kill(pid, signal.SIGTERM)
+ try:
+ os.kill(pid, signal.SIGTERM)
+ os.kill(pid, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
f = open(logfile, 'a')
args = shlex.split(cmd)
extra_env = dict(os.environ, **extra_env)
- try:
- proc = subprocess.Popen(args, stdout=f, stderr=f, env=extra_env)
- except FileNotFoundError:
- f.write('Illegal cmd %s\n' % cmd)
- signalexit()
+ proc = subprocess.Popen(args, stdout=f, stderr=f, env=extra_env)
try:
proc.wait(timeout)