mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
Use custom "argc" and "argv" exposing. Fixes #6
This commit is contained in:
@@ -148,10 +148,10 @@ namespace hex {
|
||||
}
|
||||
|
||||
bool LoaderScript::processFile(std::string_view scriptPath) {
|
||||
Py_SetProgramName(Py_DecodeLocale(__argv[0], nullptr));
|
||||
Py_SetProgramName(Py_DecodeLocale(mainArgv[0], nullptr));
|
||||
|
||||
if (std::filesystem::exists(std::filesystem::path(__argv[0]).parent_path().string() + "/lib/python3.8"))
|
||||
Py_SetPythonHome(Py_DecodeLocale(std::filesystem::path(__argv[0]).parent_path().string().c_str(), nullptr));
|
||||
if (std::filesystem::exists(std::filesystem::path(mainArgv[0]).parent_path().string() + "/lib/python3.8"))
|
||||
Py_SetPythonHome(Py_DecodeLocale(std::filesystem::path(mainArgv[0]).parent_path().string().c_str(), nullptr));
|
||||
|
||||
PyImport_AppendInittab("_imhex", []() -> PyObject* {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user