mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-22 19:59:07 -05:00
fix: keep cmd.exe off the terminal under WSL
Reading the Windows variables through cmd.exe let it consume the answer typed at the first prompt: a WSL run exited 0 with nothing installed.
This commit is contained in:
1 parent
3bb178bb74
commit
f19dcba545
4 files changed
+9
-4
No files matched your search
@@ -2812,7 +2812,10 @@ class WindowsSeenFromWsl(unittest.TestCase):
|
||||
def test_the_windows_variables_are_read_through_cmd(self):
|
||||
answers = {"USERPROFILE": "C:\\Users\\me", "APPDATA": "C:\\Users\\me\\AppData\\Roaming"}
|
||||
|
||||
def cmd(argv, **_kwargs):
|
||||
def cmd(argv, **kwargs):
|
||||
# cmd.exe must not read the terminal: it swallowed the answer
|
||||
# typed at the first prompt.
|
||||
self.assertIs(kwargs.get("stdin"), subprocess.DEVNULL)
|
||||
name = argv[-1].split("%")[1]
|
||||
return subprocess.CompletedProcess(argv, 0, answers.get(name, f"%{name}%") + "\r\n", "")
|
||||
|
||||
|
||||
Reference in new issue
Block a user