commit:     76ae9884fa95e273e288a8dffb3332f367b47f5b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 21 16:59:54 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Dec 21 16:59:54 2025 +0000
URL:        https://gitweb.gentoo.org/proj/gpyutils.git/commit/?id=76ae9884

gpy-impl: Continue on exceptions

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 gpyutils/scripts/impl.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/gpyutils/scripts/impl.py b/gpyutils/scripts/impl.py
index 69cfb70..be38617 100755
--- a/gpyutils/scripts/impl.py
+++ b/gpyutils/scripts/impl.py
@@ -50,8 +50,15 @@ def main(prog_name, *argv):
         else:
             to_remove.update(impls)
 
+    ret = 0
     for ebuild in ebuilds:
-        with EbuildMangler(ebuild) as em:
+        try:
+            em = EbuildMangler(ebuild)
+        except (KeyError, ValueError) as exc:
+            print(exc, file=sys.stderr)
+            ret = 1
+            continue
+        with em:
             before = em.value
             for x in to_add:
                 em.add(x.r1_name)
@@ -62,7 +69,7 @@ def main(prog_name, *argv):
             print(f"{ANSI.red}-PYTHON_COMPAT=({before}){ANSI.reset}")
             print(f"{ANSI.green}+PYTHON_COMPAT=({after}){ANSI.reset}")
 
-    return 0
+    return ret
 
 
 def entry_point():

Reply via email to