From 6f8244fdfd2a9c588469ee063a76e7959887d208 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Wed, 18 Dec 2024 21:04:20 -0800 Subject: [PATCH] Make mypy happy with the gdb host script. --- scripts/rr-gdb-script-host.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/rr-gdb-script-host.py b/scripts/rr-gdb-script-host.py index 24ed0c13e0b..1c0deb4224d 100755 --- a/scripts/rr-gdb-script-host.py +++ b/scripts/rr-gdb-script-host.py @@ -2,7 +2,7 @@ """ rr-gdb-script-host.py """ # Performs a limited emulation of the runtime environment of gdb scripts so that # we can run them for `rr sources` to locate debug information. -from typing import Optional, List, Callable +from typing import Optional, List, Callable, Type import logging import os import signal @@ -108,7 +108,7 @@ class GdbApiEvents(GdbApiObject): @property def new_objfile(self) -> GdbNewObjfileEvents: logging.debug("gdb.events.new_objfile") - if self._new_objfile == None: + if self._new_objfile is None: self._new_objfile = GdbNewObjfileEvents(self.gdb) return self._new_objfile @@ -158,14 +158,14 @@ def lookup_global_symbol(self, s: str) -> Optional[object]: def current_progspace(self) -> GdbProgspace: logging.debug("gdb.current_progspace()") - if self._current_progspace == None: + if self._current_progspace is None: self._current_progspace = GdbProgspace(self.gdb) return self._current_progspace @property def events(self) -> GdbApiEvents: logging.debug("gdb.events") - if self._events == None: + if self._events is None: self._events = GdbApiEvents(self.gdb) return self._events @@ -174,7 +174,7 @@ def COMMAND_USER(self) -> int: return 13 @property - def Command(self) -> DebuggerExtensionCommand: + def Command(self) -> Type[DebuggerExtensionCommand]: return DebuggerExtensionCommand if __name__ == '__main__':