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

avoid using relative path in fb_py_win_main

Summary:
After some experimenting, it is a little awkward if we want to specify a relative path based on the executable location. We'd need to add a bunch of path calculations to make it right, and I don't think the added complexity is really worth the effort.

As a result, let's just remove the use of relative path, and if we ever want to ship a copy of Python distribution, we can place it under the same directory as the binary.

Reviewed By: chadaustin

Differential Revision: D22394180

fbshipit-source-id: 86d27f6d16a03fe08826b5e5eafcef2a1c77997f
parent 5b5359fe
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#define PATH_SIZE 1024 #define PATH_SIZE 32768
typedef int (*Py_Main)(int, wchar_t**); typedef int (*Py_Main)(int, wchar_t**);
...@@ -46,7 +46,7 @@ int locate_py_main(int argc, wchar_t **argv) { ...@@ -46,7 +46,7 @@ int locate_py_main(int argc, wchar_t **argv) {
// last added directory has highest priority // last added directory has highest priority
add_search_path(L"C:\\Python36\\"); add_search_path(L"C:\\Python36\\");
add_search_path(L"C:\\Python37\\"); add_search_path(L"C:\\Python37\\");
add_search_path(L"..\\python\\"); add_search_path(L"C:\\Python38\\");
python_dll = LoadLibraryExW(L"python3.dll", NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); python_dll = LoadLibraryExW(L"python3.dll", NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
......
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