summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_launcher.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_launcher.py b/Lib/test/test_launcher.py
index 835a51e..9e26590 100644
--- a/Lib/test/test_launcher.py
+++ b/Lib/test/test_launcher.py
@@ -238,9 +238,11 @@ class RunPyMixin:
return data
def py_ini(self, content):
- if not self.py_exe:
- self.py_exe = self.find_py()
- return PreservePyIni(self.py_exe.with_name("py.ini"), content)
+ local_appdata = os.environ.get("LOCALAPPDATA")
+ if not local_appdata:
+ raise unittest.SkipTest("LOCALAPPDATA environment variable is "
+ "missing or empty")
+ return PreservePyIni(Path(local_appdata) / "py.ini", content)
@contextlib.contextmanager
def script(self, content, encoding="utf-8"):