mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-24 14:00:32 -04:00
[pyupgrade] tests/
(#10347)
This commit is contained in:
parent
879d8c1ee1
commit
89cfc3dd98
20 changed files with 45 additions and 58 deletions
|
@ -550,12 +550,12 @@ class FakeRedisPubSubProtocol(Protocol):
|
|||
if obj is None:
|
||||
return "$-1\r\n"
|
||||
if isinstance(obj, str):
|
||||
return "${len}\r\n{str}\r\n".format(len=len(obj), str=obj)
|
||||
return f"${len(obj)}\r\n{obj}\r\n"
|
||||
if isinstance(obj, int):
|
||||
return ":{val}\r\n".format(val=obj)
|
||||
return f":{obj}\r\n"
|
||||
if isinstance(obj, (list, tuple)):
|
||||
items = "".join(self.encode(a) for a in obj)
|
||||
return "*{len}\r\n{items}".format(len=len(obj), items=items)
|
||||
return f"*{len(obj)}\r\n{items}"
|
||||
|
||||
raise Exception("Unrecognized type for encoding redis: %r: %r", type(obj), obj)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue