comparison 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
comparison
equal deleted inserted replaced
49852:564d360fc98e 49853:e63ab79b2fa1
241 certlist = re.split(br'\n\n {6}key ["\[]', certlist) 241 certlist = re.split(br'\n\n {6}key ["\[]', certlist)
242 for e in certlist: 242 for e in certlist:
243 m = self.cert_re.match(e) 243 m = self.cert_re.match(e)
244 if m: 244 if m:
245 name, value = m.groups() 245 name, value = m.groups()
246 assert value is not None # help pytype
246 value = value.replace(br'\"', b'"') 247 value = value.replace(br'\"', b'"')
247 value = value.replace(br'\\', b'\\') 248 value = value.replace(br'\\', b'\\')
248 certs[name] = value 249 certs[name] = value
249 # Monotone may have subsecond dates: 2005-02-05T09:39:12.364306 250 # Monotone may have subsecond dates: 2005-02-05T09:39:12.364306
250 # and all times are stored in UTC 251 # and all times are stored in UTC