Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 43882:a21a6dad4b38
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
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 15 Dec 2019 21:36:06 -0500 |
parents | b5655f337bd7 |
children | 09bcbeacedc7 |
comparison
equal
deleted
inserted
replaced
43881:b5655f337bd7 | 43882:a21a6dad4b38 |
---|---|
1170 vparts, extra = b'', v | 1170 vparts, extra = b'', v |
1171 elif m.group(2): | 1171 elif m.group(2): |
1172 vparts, extra = m.groups() | 1172 vparts, extra = m.groups() |
1173 else: | 1173 else: |
1174 vparts, extra = m.group(1), None | 1174 vparts, extra = m.group(1), None |
1175 | |
1176 assert vparts is not None # help pytype | |
1175 | 1177 |
1176 vints = [] | 1178 vints = [] |
1177 for i in vparts.split(b'.'): | 1179 for i in vparts.split(b'.'): |
1178 try: | 1180 try: |
1179 vints.append(int(i)) | 1181 vints.append(int(i)) |