Code

Fix for Python 2.5
authorSven Velt <sven@velt.de>
Thu, 26 Aug 2010 11:44:40 +0000 (13:44 +0200)
committerSven Velt <sven@velt.de>
Thu, 26 Aug 2010 11:44:40 +0000 (13:44 +0200)
Signed-off-by: Sven Velt <sven@velt.de>
nagixsc/__init__.py

index 644c9ab624b78cc35b748f5a46637cd3d67e5e31..182e7332b7c6d4704533303ac352e4c39c314ee1 100644 (file)
@@ -99,7 +99,10 @@ def exec_check(host_name, service_descr, cmdline, timeout=None, timeout_returnco
        if timeout:
                signal.alarm(0)
                try:
-                       cmd.terminate()
+                       if sys.version_info >= (2, 6):
+                               cmd.terminate()
+                       else:
+                               os.kill(cmd.pid, 15)
                except OSError:
                        pass