Skip to content

Commit f6b1f2d

Browse files
committed
Make env var "private"
1 parent a8427d8 commit f6b1f2d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lib/test/test_launcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def run_py(self, args, env=None, allow_fail=False, expect_returncode=0, argv=Non
228228
**{k.upper(): v for k, v in (env or {}).items()},
229229
}
230230
if ini_dir := getattr(self, '_ini_dir', None):
231-
env.setdefault("PYLAUNCHER_INIDIR", ini_dir)
231+
env.setdefault("_PYLAUNCHER_INIDIR", ini_dir)
232232
if not argv:
233233
argv = [self.py_exe, *args]
234234
with subprocess.Popen(

PC/launcher2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,8 +922,8 @@ _readIni(const wchar_t *section, const wchar_t *settingName, wchar_t *buffer, in
922922
{
923923
wchar_t iniPath[MAXLEN];
924924
int n;
925-
// Check for PYLAUNCHER_INIDIR override (used for test isolation)
926-
DWORD len = GetEnvironmentVariableW(L"PYLAUNCHER_INIDIR", iniPath, MAXLEN);
925+
// Check for _PYLAUNCHER_INIDIR override (used for test isolation)
926+
DWORD len = GetEnvironmentVariableW(L"_PYLAUNCHER_INIDIR", iniPath, MAXLEN);
927927
if (len && len < MAXLEN) {
928928
if (join(iniPath, MAXLEN, L"py.ini")) {
929929
debug(L"# Reading from %s for %s/%s\n", iniPath, section, settingName);
@@ -933,7 +933,7 @@ _readIni(const wchar_t *section, const wchar_t *settingName, wchar_t *buffer, in
933933
return n;
934934
}
935935
}
936-
// When PYLAUNCHER_INIDIR is set, skip the default locations
936+
// When _PYLAUNCHER_INIDIR is set, skip the default locations
937937
return 0;
938938
}
939939
if (SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, iniPath)) &&

0 commit comments

Comments
 (0)