From 5fd00512bff4c588f52e84bccb06a6c8b2d0e95d Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Tue, 9 Dec 2025 23:44:56 +0800 Subject: [PATCH] Update main.c --- src2/main.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src2/main.c b/src2/main.c index 2b9b9256..d78cdcb5 100644 --- a/src2/main.c +++ b/src2/main.c @@ -94,18 +94,16 @@ int main(int argc, char** argv) { char* source = read_file(filename); if(source) { - if(!py_exec(source, filename, EXEC_MODE, NULL)) - py_printexc(); - else { - if(profile) { - char* json_report = py_profiler_report(); - FILE* report_file = fopen("profiler_report.json", "w"); - if(report_file) { - fprintf(report_file, "%s", json_report); - fclose(report_file); - } - PK_FREE(json_report); + if(!py_exec(source, filename, EXEC_MODE, NULL)) py_printexc(); + + if(profile) { + char* json_report = py_profiler_report(); + FILE* report_file = fopen("profiler_report.json", "w"); + if(report_file) { + fprintf(report_file, "%s", json_report); + fclose(report_file); } + PK_FREE(json_report); } PK_FREE(source);