Fix APPX registry key generation (GH-17489)

(cherry picked from commit e89e159b18)

Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
Miss Islington (bot) 2019-12-09 09:02:22 -08:00 committed by GitHub
parent 0d57db27f2
commit c5a2a974d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 11 deletions

View File

@ -339,7 +339,17 @@ def _get_registry_entries(ns, root="", d=None):
for key, value in d.items():
if key == "_condition":
continue
elif isinstance(value, dict):
if value is SPECIAL_LOOKUP:
if key == "SysArchitecture":
value = {
"win32": "32bit",
"amd64": "64bit",
"arm32": "32bit",
"arm64": "64bit",
}[ns.arch]
else:
raise ValueError(f"Key '{key}' unhandled for special lookup")
if isinstance(value, dict):
cond = value.get("_condition")
if cond and not cond(ns):
continue
@ -349,16 +359,6 @@ def _get_registry_entries(ns, root="", d=None):
if len(fullkey.parts) > 1:
yield str(fullkey), None, None
yield from _get_registry_entries(ns, fullkey, value)
elif value is SPECIAL_LOOKUP:
if key == "SysArchitecture":
return {
"win32": "32bit",
"amd64": "64bit",
"arm32": "32bit",
"arm64": "64bit",
}[ns.arch]
else:
raise ValueError(f"Key '{key}' unhandled for special lookup")
elif len(r.parts) > 1:
yield str(r), key, value