Skip to content

Commit d173f88

Browse files
committed
Update
1 parent a76ad01 commit d173f88

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/cbapi/response/models.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,15 +2320,17 @@ def crossprocs(self):
23202320

23212321
@property
23222322
def parents(self):
2323-
try:
2324-
parent_proc = self.parent
2325-
while (parent_proc and parent_proc.id and parent_proc.process_md5):
2326-
yield parent_proc
2327-
parent_proc = parent_proc.parent
2328-
except:
2323+
current_process = self
2324+
while True:
2325+
try :
2326+
parent = current_process.parent
2327+
if parent.get('pid',-1) == -1:
2328+
break
2329+
yield parent
2330+
current_process = parent
2331+
except ObjectNotFoundError:
2332+
return
23292333
return
2330-
return
2331-
23322334
@property
23332335
def children(self):
23342336
"""

0 commit comments

Comments
 (0)