Skip to content

Commit c81a6f7

Browse files
committed
Fix inversion of only_active_thread when all_threads is set
`all_threads` and `only_active_thread` are mutually exclusive. The non-free-threaded code path incorrectly passed `only_active_thread=bool(all_threads)`, which inverted the intended semantics. Fix this by negating `all_threads`. Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
1 parent 23c3bcf commit c81a6f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/profiling/sampling/sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def _new_unwinder(self, native, gc, opcodes, skip_non_matching_threads):
7272
)
7373
else:
7474
unwinder = _remote_debugging.RemoteUnwinder(
75-
self.pid, only_active_thread=bool(self.all_threads), mode=self.mode, native=native, gc=gc,
75+
self.pid, only_active_thread=(not self.all_threads), mode=self.mode, native=native, gc=gc,
7676
opcodes=opcodes, skip_non_matching_threads=skip_non_matching_threads,
7777
cache_frames=True, stats=self.collect_stats
7878
)

0 commit comments

Comments
 (0)