1
0
mirror of https://github.com/arsenetar/dupeguru-cocoa.git synced 2026-03-13 19:11:39 +00:00

Minor Changes

- Improve startup debugging of python errors
- Fix issue with multiprocessing in newer python versions
This commit is contained in:
2021-08-14 18:19:14 -05:00
parent c2ec4c3fe3
commit 8abf4de916
2 changed files with 10 additions and 3 deletions

View File

@@ -25,14 +25,17 @@ int main(int argc, char *argv[])
Py_Initialize();
PyGILState_STATE gilState = PyGILState_Ensure();
FILE* fp = fopen([mainpy UTF8String], "r");
PyRun_SimpleFile(fp, [mainpy UTF8String]);
int result = PyRun_SimpleFile(fp, [mainpy UTF8String]);
if (result != 0) {
return result;
}
fclose(fp);
PyGILState_Release(gilState);
if (gilState == PyGILState_LOCKED) {
PyThreadState_Swap(NULL);
PyEval_ReleaseLock();
}
int result = NSApplicationMain(argc, (const char **) argv);
result = NSApplicationMain(argc, (const char **) argv);
Py_Finalize();
return result;
}