comparison mercurial/wireprotoframing.py @ 51699:ca7bde5dbafb

black: format the codebase with 23.3.0 The CI has moved to 23.3.0, which is the last version that supports 3.7 at runtime, so we should honor this change. # skip-blame mass-reformating only
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 18 Jul 2024 12:36:12 +0200
parents 7f0cb9ee0534
children 278af66e6595
comparison
equal deleted inserted replaced
51698:b0a4de6c14f8 51699:ca7bde5dbafb
544 formatters to be applied at rendering time. In terms of the ``ui`` 544 formatters to be applied at rendering time. In terms of the ``ui``
545 class, each atom corresponds to a ``ui.write()``. 545 class, each atom corresponds to a ``ui.write()``.
546 """ 546 """
547 atomdicts = [] 547 atomdicts = []
548 548
549 for (formatting, args, labels) in atoms: 549 for formatting, args, labels in atoms:
550 # TODO look for localstr, other types here? 550 # TODO look for localstr, other types here?
551 551
552 if not isinstance(formatting, bytes): 552 if not isinstance(formatting, bytes):
553 raise ValueError(b'must use bytes formatting strings') 553 raise ValueError(b'must use bytes formatting strings')
554 for arg in args: 554 for arg in args:
1196 stream, 1196 stream,
1197 requestid, 1197 requestid,
1198 b'%s' % stringutil.forcebytestr(e), 1198 b'%s' % stringutil.forcebytestr(e),
1199 errtype=b'server', 1199 errtype=b'server',
1200 ): 1200 ):
1201
1202 yield frame 1201 yield frame
1203 1202
1204 break 1203 break
1205 1204
1206 try: 1205 try:
1257 o, wireprototypes.indefinitebytestringresponse 1256 o, wireprototypes.indefinitebytestringresponse
1258 ): 1257 ):
1259 for chunk in cborutil.streamencodebytestringfromiter( 1258 for chunk in cborutil.streamencodebytestringfromiter(
1260 o.chunks 1259 o.chunks
1261 ): 1260 ):
1262
1263 for frame in emitter.send(chunk): 1261 for frame in emitter.send(chunk):
1264 yield frame 1262 yield frame
1265 1263
1266 # A regular object is CBOR encoded. 1264 # A regular object is CBOR encoded.
1267 else: 1265 else: