typing: add an assertion to util.versiontuple
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 15 Dec 2019 21:36:06 -0500
changeset 43882 a21a6dad4b38
parent 43881 b5655f337bd7
child 43883 09bcbeacedc7
typing: add an assertion to util.versiontuple Fixes the following warning: line 1177, in versiontuple: No attribute 'split' on None [attribute-error] In Optional[bytes] Differential Revision: https://phab.mercurial-scm.org/D7676
mercurial/util.py
--- a/mercurial/util.py	Sun Dec 15 21:28:30 2019 -0500
+++ b/mercurial/util.py	Sun Dec 15 21:36:06 2019 -0500
@@ -1173,6 +1173,8 @@
     else:
         vparts, extra = m.group(1), None
 
+    assert vparts is not None  # help pytype
+
     vints = []
     for i in vparts.split(b'.'):
         try: