Avoid None frames in profile.process
Fixes
@@ -2272,9 +2272,12 @@ class Worker(WorkerBase):
frames = sys._current_frames()
frames = {ident: frames[ident] for ident in active_threads}
for ident, frame in frames.items():
+ if frame is not None:
key = key_split(active_threads[ident])
- profile.process(frame, None, self.profile_recent, stop='_concurrent_futures_thread.py')
- profile.process(frame, None, self.profile_keys[key], stop='_concurrent_futures_thread.py')
+ profile.process(frame, None, self.profile_recent,
+ stop='_concurrent_futures_thread.py')
+ profile.process(frame, None, self.profile_keys[key],
+ stop='_concurrent_futures_thread.py')
stop = time()
if self.digests is not None:
self.digests['profile-duration'].add(stop - start)
