D1101: wireproto: use a proper exception instead of `assert False`
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Mon Oct 16 01:30:55 UTC 2017
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1101
AFFECTED FILES
mercurial/wireproto.py
CHANGE DETAILS
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -325,7 +325,8 @@
continue
keytype = gboptsmap.get(key)
if keytype is None:
- assert False, 'unexpected'
+ raise error.ProgrammingError(
+ 'Unexpectedly None keytype for key %s' % key)
elif keytype == 'nodes':
value = encodelist(value)
elif keytype in ('csv', 'scsv'):
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list