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

login
register
mail settings
Submitter phabricator
Date Nov. 19, 2019, 3:51 a.m.
Message ID <612519a20ff8f0965a0c093663d8b837@localhost.localdomain>
Download mbox | patch
Permalink /patch/43350/
State Not Applicable
Headers show

Comments

phabricator - Nov. 19, 2019, 3:51 a.m.
Closed by commit rHG23ad4f0c1578: debugcommands: add assertions to convince pytype peer is not None (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

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

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




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

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -4161,6 +4161,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))
@@ -4241,6 +4242,7 @@ 
                 )
 
         elif action == b'close':
+            assert peer is not None
             peer.close()
         elif action == b'readavailable':
             if not stdout or not stderr: