Make mypy 1.11 happy

This commit is contained in:
Kovid Goyal 2024-07-20 10:15:01 +05:30
parent 681a2b7b28
commit ae8da889c4
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 11 additions and 7 deletions

View file

@ -317,8 +317,10 @@ def format_cmd(p: Callable[..., None], name: str, cmd: RemoteCommand) -> None:
else:
title = f'{title} (optional)'
p(f':code:`{title}`')
p(' ', desc), p()
p(), p()
p(' ', desc)
p()
p()
p()
with open('generated/rc.rst', 'w') as f:
p = partial(print, file=f)

View file

@ -48,10 +48,12 @@ def setup_debug_print() -> bool:
def send_to_kitten(x: Any) -> None:
f = sys.__stdout__
assert f is not None
try:
sys.__stdout__.buffer.write(json.dumps(x).encode())
sys.__stdout__.buffer.write(b'\n')
sys.__stdout__.buffer.flush()
f.buffer.write(json.dumps(x).encode())
f.buffer.write(b'\n')
f.buffer.flush()
except BrokenPipeError:
raise SystemExit('Pipe to kitten was broken while sending data to it')

View file

@ -836,8 +836,8 @@ def peer_message_received(self, msg_bytes: bytes, peer_id: int, is_remote_contro
focused_os_window = os_window_id
if opts.background_opacity != get_options().background_opacity:
self._set_os_window_background_opacity(os_window_id, opts.background_opacity)
if data.get('notify_on_os_window_death'):
self.os_window_death_actions[os_window_id] = partial(self.notify_on_os_window_death, data['notify_on_os_window_death'])
if n := data.get('notify_on_os_window_death'):
self.os_window_death_actions[os_window_id] = partial(self.notify_on_os_window_death, n)
if focused_os_window > 0:
focus_os_window(focused_os_window, True, activation_token)
elif activation_token and is_wayland() and os_window_id: