mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
bpo-46297: Fix interpreter crash on startup with multiple PythonPaths set in registry (GH-30466)
This commit is contained in:
parent
74d1663580
commit
c9dc1f491e
4 changed files with 13 additions and 14 deletions
|
@ -734,12 +734,15 @@ class MockWinreg:
|
|||
return n.removeprefix(prefix)
|
||||
raise OSError("end of enumeration")
|
||||
|
||||
def QueryValue(self, hkey):
|
||||
def QueryValue(self, hkey, subkey):
|
||||
if verbose:
|
||||
print(f"QueryValue({hkey})")
|
||||
print(f"QueryValue({hkey}, {subkey})")
|
||||
hkey = hkey.casefold()
|
||||
if hkey not in self.open:
|
||||
raise RuntimeError("key is not open")
|
||||
if subkey:
|
||||
subkey = subkey.casefold()
|
||||
hkey = f'{hkey}\\{subkey}'
|
||||
try:
|
||||
return self.keys[hkey]
|
||||
except KeyError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue