From: Sven Velt Date: Thu, 26 Aug 2010 11:44:40 +0000 (+0200) Subject: Fix for Python 2.5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9e2702ab16e051bfc7ef03748bb5fdf8ce10a816;p=nagixsc.git Fix for Python 2.5 Signed-off-by: Sven Velt --- diff --git a/nagixsc/__init__.py b/nagixsc/__init__.py index 644c9ab..182e733 100644 --- a/nagixsc/__init__.py +++ b/nagixsc/__init__.py @@ -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