changeset 47763:76dccbbe73fd stable

typing: convert an annotation to an assertion in commands.py Pytype was happy with the annotation at one point, but 2021.04.15 now complains. Differential Revision: https://phab.mercurial-scm.org/D11206
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 21 Jul 2021 15:34:35 -0400
parents f48a688a7044
children 6b9ad3a0c348
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Jul 20 23:04:28 2021 +0200
+++ b/mercurial/commands.py	Wed Jul 21 15:34:35 2021 -0400
@@ -75,12 +75,6 @@
     urlutil,
 )
 
-if pycompat.TYPE_CHECKING:
-    from typing import (
-        List,
-    )
-
-
 table = {}
 table.update(debugcommandsmod.command._table)
 
@@ -3341,7 +3335,8 @@
                 )
             # checking that newnodes exist because old state files won't have it
             elif statedata.get(b'newnodes') is not None:
-                nn = statedata[b'newnodes']  # type: List[bytes]
+                nn = statedata[b'newnodes']
+                assert isinstance(nn, list)  # list of bytes
                 nn.append(node)
 
     # remove state when we complete successfully