Skip to content

Commit 0ddbb26

Browse files
committed
Fire profile returns without a per-frame f_trace
setprofile must see PY_RETURN/PY_YIELD even when f_trace is unset. Drop EXPECTED_FAILURE from the pdb doctest and unxfail test_unfinished_generator. Assisted-by: Grok:grok-4.6
1 parent 05f1a8e commit 0ddbb26

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎Lib/test/test_doctest/test_doctest.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ def test_pdb_set_trace():
21292129
... 'list', # list source from example 3
21302130
... 'continue', # stop debugging
21312131
... ''])
2132-
>>> try: runner.run(test) # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE
2132+
>>> try: runner.run(test)
21332133
... finally: sys.stdin = real_stdin
21342134
... # doctest: +NORMALIZE_WHITESPACE
21352135
> <doctest foo-bar@baz[1]>(3)g()

‎Lib/test/test_sys_setprofile.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ def g(p):
260260
(1, 'return', g_ident),
261261
])
262262

263-
@unittest.expectedFailure # TODO: RUSTPYTHON
264263
def test_unfinished_generator(self):
265264
def f():
266265
for i in range(2):

‎crates/vm/src/frame.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,7 +3445,7 @@ impl ExecutingFrame<'_> {
34453445
/// instead of suspending.
34463446
fn yield_value_event(&mut self, vm: &VirtualMachine) -> PyResult<bool> {
34473447
let lasti_before = self.lasti();
3448-
if vm.use_tracing.get() && self.trace_is_set(vm) {
3448+
if vm.use_tracing.get() {
34493449
let value = self.top_value().to_owned();
34503450
vm.trace_event_what(
34513451
crate::protocol::TraceEvent::Return,
@@ -5541,7 +5541,7 @@ impl ExecutingFrame<'_> {
55415541
}
55425542
Instruction::ReturnValue => {
55435543
let value = self.pop_value();
5544-
if vm.use_tracing.get() && self.trace_is_set(vm) {
5544+
if vm.use_tracing.get() {
55455545
vm.trace_event_what(
55465546
crate::protocol::TraceEvent::Return,
55475547
monitoring::WHAT_PY_RETURN,
@@ -8014,7 +8014,7 @@ impl ExecutingFrame<'_> {
80148014
}
80158015
Instruction::InstrumentedReturnValue => {
80168016
let value = self.pop_value();
8017-
if vm.use_tracing.get() && self.trace_is_set(vm) {
8017+
if vm.use_tracing.get() {
80188018
vm.trace_event_what(
80198019
crate::protocol::TraceEvent::Return,
80208020
monitoring::WHAT_PY_RETURN,

0 commit comments

Comments
 (0)