D7407: debugcommands: add assertions to convince pytype peer is not None

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Fri Nov 15 16:33:05 UTC 2019


durin42 updated this revision to Diff 18158.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7407?vs=18100&id=18158

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7407/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7407

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -4144,6 +4144,7 @@
                 _(b'sending batch with %d sub-commands\n')
                 % len(batchedcommands)
             )
+            assert peer is not None
             for i, chunk in enumerate(peer._submitbatch(batchedcommands)):
                 ui.status(
                     _(b'response #%d: %s\n') % (i, stringutil.escapestr(chunk))
@@ -4224,6 +4225,7 @@
                 )
 
         elif action == b'close':
+            assert peer is not None
             peer.close()
         elif action == b'readavailable':
             if not stdout or not stderr:



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


More information about the Mercurial-devel mailing list