annotations: fix _remove_entry() logic
authorAndrea Righi <andrea.righi@canonical.com>
Fri, 3 Feb 2023 10:55:55 +0000 (11:55 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Fri, 3 Feb 2023 10:55:55 +0000 (11:55 +0100)
Drop unnecessary delete statements and fix the code to properly remove
the entry in _remove_entry().

Reported-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
kconfig/annotations.py

index 3eb2c078c097b48ad6851e43beb76fea99662593..df3bf11e7320fd555902bb296b94eab8b9896a00 100644 (file)
@@ -120,11 +120,7 @@ class Annotation(Config):
         self._parse_body(data)
 
     def _remove_entry(self, config : str):
-        if 'policy' in self.config[config]:
-            del self.config[config]['policy']
-        if 'note' in self.config[config]:
-            del self.config[config]['note']
-        if not self.config[config]:
+        if self.config[config]:
             del self.config[config]
 
     def remove(self, config : str, arch: str = None, flavour: str = None):