<test>fix psutil.procsee error

This commit is contained in:
liuyq-617 2021-01-26 16:51:00 +08:00
parent 23b69f62d3
commit d84d06814c
1 changed files with 7 additions and 3 deletions

View File

@ -194,9 +194,13 @@ class TDSql:
pstate = 0
pl = psutil.pids()
for pid in pl:
if psutil.Process(pid).name == 'taosd':
pstate = 1
break
try:
if psutil.Process(pid).name() == 'taosd':
print('have already started')
pstate = 1
break
except psutil.NoSuchProcess:
pass
if pstate:
tdLog.sleep(5)
continue