Skip to content

Commit 3d656b3

Browse files
committed
Fix test and instrumentation_tools
1 parent a9ad363 commit 3d656b3

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Lib/test/test_free_threading/test_monitoring.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ def test_register_callback(self):
219219
self.assertEqual(ref(), None)
220220

221221
def test_set_local_trace_opcodes(self):
222-
return
223222
def trace(frame, event, arg):
224223
frame.f_trace_opcodes = True
225224
return trace
@@ -233,7 +232,7 @@ def f():
233232
with l:
234233
pass
235234

236-
t = threading.Thread(target=f)
235+
t = Thread(target=f)
237236
t.start()
238237
for i in range(3000):
239238
with l:

Python/instrumentation.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ instrumentation_cross_checks(PyInterpreterState *interp, PyCodeObject *code)
10001000
return monitors_equals(code->_co_monitoring->active_monitors, expected);
10011001
}
10021002

1003-
static inline
1003+
static
10041004
int debug_check_sanity(PyInterpreterState *interp, PyCodeObject *code)
10051005
{
10061006
int res;
@@ -1690,11 +1690,8 @@ update_instrumentation_data(PyCodeObject *code, PyInterpreterState *interp)
16901690
PyErr_NoMemory();
16911691
return -1;
16921692
}
1693-
// Initialize all of the instructions so if local events change while another thread is executing
1694-
// we know what the original opcode was.
16951693
for (int i = 0; i < code_len; i++) {
1696-
int opcode = _PyCode_CODE(code)[i].op.code;
1697-
code->_co_monitoring->per_instruction_tools[i] = _PyOpcode_Deopt[opcode];
1694+
code->_co_monitoring->per_instruction_tools[i] = 0;
16981695
}
16991696
}
17001697
}

0 commit comments

Comments
 (0)