kconfig: fix incompatibility with python < 3.9
authorAndrea Righi <andrea.righi@canonical.com>
Fri, 2 Jun 2023 13:27:30 +0000 (15:27 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Fri, 2 Jun 2023 13:27:30 +0000 (15:27 +0200)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
kconfig/annotations.py

index e20a087f962cbe32bcc4eb7d6610775b5998c317..1d5e40cb67de342cdddb4265a074dc3370ebad48 100644 (file)
@@ -342,7 +342,11 @@ class Annotation(Config):
                 # new notes that are different than the old ones.
                 old_val = tmp_a.config.get(conf)
                 if old_val and 'policy' in old_val:
-                    if old_val['policy'] == old_val['policy'] | new_val['policy']:
+                    try:
+                        can_skip = old_val['policy'] == old_val['policy'] | new_val['policy']
+                    except TypeError:
+                        can_skip = old_val['policy'] == {**old_val['policy'], **new_val['policy']}
+                    if can_skip:
                         if 'note' not in new_val:
                             continue
                         if 'note' in old_val and 'note' in new_val: