mirror of
https://github.com/pocketpy/pocketpy
synced 2025-12-11 12:40:18 +00:00
Update main.c
This commit is contained in:
parent
d2d4bfa29b
commit
5fd00512bf
20
src2/main.c
20
src2/main.c
@ -94,18 +94,16 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
char* source = read_file(filename);
|
char* source = read_file(filename);
|
||||||
if(source) {
|
if(source) {
|
||||||
if(!py_exec(source, filename, EXEC_MODE, NULL))
|
if(!py_exec(source, filename, EXEC_MODE, NULL)) py_printexc();
|
||||||
py_printexc();
|
|
||||||
else {
|
if(profile) {
|
||||||
if(profile) {
|
char* json_report = py_profiler_report();
|
||||||
char* json_report = py_profiler_report();
|
FILE* report_file = fopen("profiler_report.json", "w");
|
||||||
FILE* report_file = fopen("profiler_report.json", "w");
|
if(report_file) {
|
||||||
if(report_file) {
|
fprintf(report_file, "%s", json_report);
|
||||||
fprintf(report_file, "%s", json_report);
|
fclose(report_file);
|
||||||
fclose(report_file);
|
|
||||||
}
|
|
||||||
PK_FREE(json_report);
|
|
||||||
}
|
}
|
||||||
|
PK_FREE(json_report);
|
||||||
}
|
}
|
||||||
|
|
||||||
PK_FREE(source);
|
PK_FREE(source);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user