Update pkpy.c

This commit is contained in:
blueloveTH 2025-08-08 11:44:09 +08:00
parent 169e825197
commit bc51c5e19d

View File

@ -469,6 +469,9 @@ static void pkpy_configmacros_add(py_Ref dict, const char* key, int val) {
static bool pkpy_profiler_begin(int argc, py_Ref argv) {
PY_CHECK_ARGC(0);
if(pk_current_vm->trace_info.func != py_LineProfiler_tracefunc) {
return RuntimeError("py_LineProfiler_tracefunc() should be set as the trace function");
}
LineProfiler__begin(&pk_current_vm->line_profiler);
py_newnone(py_retval());
return true;