]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix APPX registry key generation (GH-17489)
authorSteve Dower <steve.dower@python.org>
Mon, 9 Dec 2019 16:43:13 +0000 (08:43 -0800)
committerGitHub <noreply@github.com>
Mon, 9 Dec 2019 16:43:13 +0000 (08:43 -0800)
PC/layout/support/appxmanifest.py

index 9e008f793cf5502588b457fc27acd23efc17d899..9a7439d027126da542baff39fdd195d593899b82 100644 (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