D1101: wireproto: use a proper exception instead of `assert False`

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Mon Oct 16 05:17:34 EDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6be264009841: wireproto: use a proper exception instead of `assert False` (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1101?vs=2793&id=2803

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, ryanmce
Cc: ryanmce, mercurial-devel


More information about the Mercurial-devel mailing list