Windows: Fix, the "sys.executable" value in onefile DLL mode could be wrong

* We mean for this to be pointing to a "python.exe" near the
  code. However, the updating code was inactive. And with the
  current "multiprocessing" plugin when that module is loaded,
  the value changes to this anyway.

* As a result this went undetected, but it's an important change
  to make sure "sys.executable" calls as a binary do not go
  unnoticed.
This commit is contained in:
Kay Hayen
2025-11-26 15:29:54 +00:00
parent 1d5b0cabb8
commit ed9db1879c

View File

@@ -73,7 +73,7 @@ static void _createGlobalConstants(PyThreadState *tstate) {
// The empty name means global.
loadConstantsBlob(tstate, &global_constants[0], "");
#if _NUITKA_EXE_MODE
#if _NUITKA_EXE_MODE || _NUITKA_DLL_MODE
/* Set the "sys.executable" path to the original CPython executable or point to inside the
distribution for standalone. */
Nuitka_SysSetObject(