diff options
author | 2017-01-22 13:21:36 +0100 | |
---|---|---|
committer | 2017-01-22 13:23:56 +0100 | |
commit | 29a6bea1536dd23adbc84454aacb2c81d0499f82 (patch) | |
tree | 2b33e0c48916a4be101dbead21c95dc11e5a691d | |
parent | sync: define project keys default values (diff) | |
download | grumpy-29a6bea1536dd23adbc84454aacb2c81d0499f82.tar.gz grumpy-29a6bea1536dd23adbc84454aacb2c81d0499f82.tar.bz2 grumpy-29a6bea1536dd23adbc84454aacb2c81d0499f82.zip |
sync: replace assert with ValueError raise
Simpler expression, probably here to stay.
-rw-r--r-- | backend/lib/sync.py | 9 |
1 files 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: |