bug fixed

This commit is contained in:
PavelMuhortov 2021-06-16 22:33:45 +03:00
parent 2f2797b508
commit e20df99b01

View File

@ -44,10 +44,10 @@ class Proc:
execlist = []
out, err = Popen(['/bin/ps', '-eo', 'pid,args'], stdout=PIPE, stderr=PIPE).communicate()
for line in out.splitlines():
execpid = line.split(b' ')[0].decode('utf-8')
exepath = line.split(b' ')[1].decode('utf-8')
execpid = line.split()[0].decode('utf-8')
exepath = line.split()[1].decode('utf-8')
exename = path.basename(exepath)
cmdline = line.split(b' ', 1)[1].decode('utf-8')
cmdline = line.split(None, 1)[1].decode('utf-8')
if execpid and exename:
execlist.append({'execpid': execpid, 'exename': exename, 'exepath': exepath, 'cmdline': cmdline})
return execlist