From e20df99b012a6beecc06fe186b7ee56cfd9138ed Mon Sep 17 00:00:00 2001 From: PavelMuhortov Date: Wed, 16 Jun 2021 22:33:45 +0300 Subject: [PATCH] bug fixed --- srchproc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srchproc.py b/srchproc.py index ce6c220..3ee56b3 100644 --- a/srchproc.py +++ b/srchproc.py @@ -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