wireproto: use a proper exception instead of `assert False`
authorAugie Fackler <augie@google.com>
Sun, 15 Oct 2017 00:06:06 -0400
changeset 34730 6be264009841
parent 34729 6f532c1a4af0
child 34731 31fdd0509de9
wireproto: use a proper exception instead of `assert False` Differential Revision: https://phab.mercurial-scm.org/D1101
mercurial/wireproto.py
--- a/mercurial/wireproto.py	Sun Oct 15 00:39:29 2017 -0400
+++ b/mercurial/wireproto.py	Sun Oct 15 00:06:06 2017 -0400
@@ -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'):