Fix for Python3

This commit is contained in:
keith 2026-03-16 20:00:47 +00:00
parent a8fe1900e6
commit 5d90fd7c3f
2 changed files with 4 additions and 6 deletions

View file

@ -3,7 +3,6 @@
import os
from glob import glob
from syslog import syslog
from string import split
import signal
pid = os.getpid()
@ -17,7 +16,7 @@ filelist = glob( 'mustang_*' )
if len( filelist ) == 1:
lockfile = filelist[0]
oldpid = split( lockfile, '_' )[1]
oldpid = lockfile.split( '_' )[1]
# See if the process still exists
# syslog( "%d: Check for path /proc/%s" % (pid, oldpid) )
@ -25,7 +24,7 @@ if len( filelist ) == 1:
# syslog( "%d: Sending sigint to pid %s" % (pid, oldpid) )
try:
os.kill( int(oldpid), signal.SIGINT )
except Exception, e:
except Exception as e:
syslog( "%d: Signal failed: %s" % (pid, e) )
pass
else: