mirror of
https://github.com/python/cpython.git
synced 2024-12-18 14:24:33 +08:00
gh-96076: Change test_launcher to use non-admin location for py.ini (GH-96091)
Patch authored by Eryksun.
This commit is contained in:
parent
18b1782192
commit
216ccacda1
@ -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"):
|
||||
|
Loading…
Reference in New Issue
Block a user