Skip to content

Commit c693932

Browse files
fanzeyifacebook-github-bot
authored andcommitted
return returncode correctly
Reviewed By: xavierd Differential Revision: D23434438 fbshipit-source-id: 813f987cf62e72c0b6704b31e6e9168006735b6f
1 parent 9599bb5 commit c693932

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build/fbcode_builder/CMake/fb_py_win_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ int locate_py_main(int argc, wchar_t **argv) {
5050

5151
python_dll = LoadLibraryExW(L"python3.dll", NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
5252

53+
int returncode = 0;
5354
if (python_dll != NULL) {
5455
pymain = (Py_Main) GetProcAddress(python_dll, "Py_Main");
5556

5657
if (pymain != NULL) {
57-
(pymain)(argc, argv);
58+
returncode = (pymain)(argc, argv);
5859
} else {
5960
fprintf(stderr, "error: %d unable to load Py_Main\n", GetLastError());
6061
}
@@ -64,7 +65,7 @@ int locate_py_main(int argc, wchar_t **argv) {
6465
fprintf(stderr, "error: %d unable to locate python3.dll\n", GetLastError());
6566
return 1;
6667
}
67-
return 0;
68+
return returncode;
6869
}
6970

7071
int wmain() {

0 commit comments

Comments
 (0)