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

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2017, 9:17 a.m.
Message ID <a7f71ba5ec535c315e99f065107c8bee@localhost.localdomain>
Download mbox | patch
Permalink /patch/24968/
State Not Applicable
Headers show

Comments

phabricator - Oct. 16, 2017, 9:17 a.m.
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




To: durin42, #hg-reviewers, ryanmce
Cc: ryanmce, mercurial-devel

Patch

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'):