Commit bc8a9f69 authored by Zeyi (Rice) Fan's avatar Zeyi (Rice) Fan Committed by Facebook GitHub Bot

return returncode correctly

Reviewed By: xavierd

Differential Revision: D23434438

fbshipit-source-id: 813f987cf62e72c0b6704b31e6e9168006735b6f
parent b6d2974b
...@@ -50,11 +50,12 @@ int locate_py_main(int argc, wchar_t **argv) { ...@@ -50,11 +50,12 @@ int locate_py_main(int argc, wchar_t **argv) {
python_dll = LoadLibraryExW(L"python3.dll", NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); python_dll = LoadLibraryExW(L"python3.dll", NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
int returncode = 0;
if (python_dll != NULL) { if (python_dll != NULL) {
pymain = (Py_Main) GetProcAddress(python_dll, "Py_Main"); pymain = (Py_Main) GetProcAddress(python_dll, "Py_Main");
if (pymain != NULL) { if (pymain != NULL) {
(pymain)(argc, argv); returncode = (pymain)(argc, argv);
} else { } else {
fprintf(stderr, "error: %d unable to load Py_Main\n", GetLastError()); fprintf(stderr, "error: %d unable to load Py_Main\n", GetLastError());
} }
...@@ -64,7 +65,7 @@ int locate_py_main(int argc, wchar_t **argv) { ...@@ -64,7 +65,7 @@ int locate_py_main(int argc, wchar_t **argv) {
fprintf(stderr, "error: %d unable to locate python3.dll\n", GetLastError()); fprintf(stderr, "error: %d unable to locate python3.dll\n", GetLastError());
return 1; return 1;
} }
return 0; return returncode;
} }
int wmain() { int wmain() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment