We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e42c93e + 132ea42 commit d2e3f5fCopy full SHA for d2e3f5f
src/cbapi/response/models.py
@@ -2334,15 +2334,17 @@ def crossprocs(self):
2334
2335
@property
2336
def parents(self):
2337
- try:
2338
- parent_proc = self.parent
2339
- while parent_proc and parent_proc.id and parent_proc.get("process_pid", -1) != -1:
2340
- yield parent_proc
2341
- parent_proc = parent_proc.parent
2342
- except:
+ current_process = self
+ while True:
+ try :
+ parent = current_process.parent
+ if not(parent) or parent.get('process_pid',-1) == -1:
+ break
2343
+ yield parent
2344
+ current_process = parent
2345
+ except ObjectNotFoundError:
2346
+ return
2347
return
- return
-
2348
2349
def children(self):
2350
"""
0 commit comments