commit:     29a6bea1536dd23adbc84454aacb2c81d0499f82
Author:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 22 12:21:36 2017 +0000
Commit:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Sun Jan 22 12:23:56 2017 +0000
URL:        https://gitweb.gentoo.org/proj/grumpy.git/commit/?id=29a6bea1

sync: replace assert with ValueError raise

Simpler expression, probably here to stay.

 backend/lib/sync.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/backend/lib/sync.py b/backend/lib/sync.py
index 0aab3bc..429d14b 100644
--- a/backend/lib/sync.py
+++ b/backend/lib/sync.py
@@ -178,10 +178,11 @@ def sync_versions():
         maintainers = []
         if 'maintainers' in pkg:
             for maint in pkg['maintainers']:
-                assert (
-                    'email' in maint and 'type' in maint,
-                    "Package %s maintainer %s entry not GLEP 67 valid" % 
(package.full_name, maint)
-                )
+                if 'email' not in maint or 'type' not in maint:
+                    raise ValueError(
+                        "Package %s maintainer %s entry not GLEP 67 valid" %
+                        (package.full_name, maint)
+                    )
 
                 email = maint['email'].lower()
                 if email in existing_maintainers:

Reply via email to