diff hgext/convert/monotone.py @ 49853:e63ab79b2fa1

typing: add some assertions that a variable isn't None In the case of blackbox, there's a default limit if one isn't explicitly supplied. For the monotone regex, neither group is optional, so a match means it's not None.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 05 Jan 2023 17:15:27 -0500
parents 176f1a0d15dc
children 1eab9e40c0c8
line wrap: on
line diff
--- a/hgext/convert/monotone.py	Thu Jan 05 17:09:41 2023 -0500
+++ b/hgext/convert/monotone.py	Thu Jan 05 17:15:27 2023 -0500
@@ -243,6 +243,7 @@
             m = self.cert_re.match(e)
             if m:
                 name, value = m.groups()
+                assert value is not None  # help pytype
                 value = value.replace(br'\"', b'"')
                 value = value.replace(br'\\', b'\\')
                 certs[name] = value