Skip to content

Commit d1fe278

Browse files
committed
Remove debugging prints
1 parent 9b8891a commit d1fe278

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

Lib/test/test_with_signal_safety.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def raise_after_offset(target_function, target_offset):
2222
target_code = target_function.__code__
2323
def inject_exception():
2424
exc = InjectedException(f"Failing after {target_offset}")
25-
print(f"Raising injected exception: {exc}")
2625
raise exc
2726
# This installs a trace hook that's implemented in C, and hence won't
2827
# trigger any of the per-bytecode processing in the eval loop

Modules/_testcapimodule.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,14 +2366,11 @@ error_injection_trace(PyObject *hook_args, PyFrameObject *frame,
23662366
}
23672367

23682368
if (((PyObject *) frame->f_code) == target_code) {
2369-
printf("Tracing frame of interest\n");
23702369
frame->f_trace_opcodes = 1;
23712370
if (what == PyTrace_OPCODE && frame->f_lasti >= target_offset) {
23722371
Py_INCREF(callback);
23732372
PyEval_SetTrace(NULL, NULL);
2374-
printf("Adding pending call after %d\n", frame->f_lasti);
23752373
if (Py_AddPendingCall(&_pending_callback, callback) < 0) {
2376-
printf("Failed to add pending call\n");
23772374
Py_DECREF(callback);
23782375
return -1;
23792376
}
@@ -2391,7 +2388,6 @@ PyObject *install_error_injection_hook(PyObject *self, PyObject *args)
23912388
&target_code, &target_offset, &callback)) {
23922389
return NULL;
23932390
}
2394-
printf("Registering trace hook\n");
23952391

23962392
PyEval_SetTrace(error_injection_trace, args);
23972393
Py_RETURN_NONE;

Python/ceval.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,13 +419,11 @@ Py_MakePendingCalls(void)
419419
PyThread_acquire_lock(pending_lock, WAIT_LOCK);
420420
j = pendingfirst;
421421
if (j == pendinglast) {
422-
printf(" No pending calls remaining\n");
423422
func = NULL; /* Queue empty */
424423
} else {
425424
func = pendingcalls[j].func;
426425
arg = pendingcalls[j].arg;
427426
pendingfirst = (j + 1) % NPENDINGCALLS;
428-
printf(" Calling %p(%p)\n", func, arg);
429427
}
430428
PyThread_release_lock(pending_lock);
431429
/* having released the lock, perform the callback */
@@ -983,15 +981,10 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
983981
*/
984982
goto fast_next_opcode;
985983
}
986-
if (handle_pending_after > first_instr) {
987-
printf("Pending calls deferred until %lu (current: %lu)\n", DEFER_OFFSET(), INSTR_OFFSET());
988-
}
989984
if (next_instr >= handle_pending_after) {
990-
printf("Checking for pending calls: %lu >= %lu?\n", INSTR_OFFSET(), DEFER_OFFSET());
991985
/* Allow for subsequent jumps backwards in the bytecode */
992986
handle_pending_after = first_instr;
993987
if (_Py_atomic_load_relaxed(&pendingcalls_to_do)) {
994-
printf(" Processing pending calls\n");
995988
if (Py_MakePendingCalls() < 0)
996989
goto error;
997990
}

0 commit comments

Comments
 (0)