Use PY3 super() zero-argument syntax
This commit is contained in:
@@ -27,7 +27,7 @@ from platformio.project.helpers import get_project_cache_dir
|
||||
|
||||
class DebugClientProcess(DebugBaseProcess):
|
||||
def __init__(self, project_dir, debug_config):
|
||||
super(DebugClientProcess, self).__init__()
|
||||
super().__init__()
|
||||
self.project_dir = project_dir
|
||||
self.debug_config = debug_config
|
||||
|
||||
@@ -55,7 +55,7 @@ class DebugClientProcess(DebugBaseProcess):
|
||||
self.debug_config.port = await self._server_process.run()
|
||||
|
||||
def connection_made(self, transport):
|
||||
super(DebugClientProcess, self).connection_made(transport)
|
||||
super().connection_made(transport)
|
||||
self._lock_session(transport.get_pid())
|
||||
# Disable SIGINT and allow GDB's Ctrl+C interrupt
|
||||
signal.signal(signal.SIGINT, lambda *args, **kwargs: None)
|
||||
@@ -64,7 +64,7 @@ class DebugClientProcess(DebugBaseProcess):
|
||||
def process_exited(self):
|
||||
if self._server_process:
|
||||
self._server_process.terminate()
|
||||
super(DebugClientProcess, self).process_exited()
|
||||
super().process_exited()
|
||||
|
||||
def close(self):
|
||||
self._unlock_session()
|
||||
|
||||
@@ -29,12 +29,12 @@ class GDBClientProcess(DebugClientProcess):
|
||||
INIT_COMPLETED_BANNER = "PlatformIO: Initialization completed"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(GDBClientProcess, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._target_is_running = False
|
||||
self._errors_buffer = b""
|
||||
|
||||
async def run(self, extra_args): # pylint: disable=arguments-differ
|
||||
await super(GDBClientProcess, self).run()
|
||||
await super().run()
|
||||
|
||||
self.generate_init_script(os.path.join(self.working_dir, self.PIO_SRC_NAME))
|
||||
gdb_path = self.debug_config.client_executable_path or "gdb"
|
||||
@@ -109,7 +109,7 @@ class GDBClientProcess(DebugClientProcess):
|
||||
fp.write("\n".join(self.debug_config.reveal_patterns(commands)))
|
||||
|
||||
def stdin_data_received(self, data):
|
||||
super(GDBClientProcess, self).stdin_data_received(data)
|
||||
super().stdin_data_received(data)
|
||||
if b"-exec-run" in data:
|
||||
if self._target_is_running:
|
||||
token, _ = data.split(b"-", 1)
|
||||
@@ -127,7 +127,7 @@ class GDBClientProcess(DebugClientProcess):
|
||||
self.transport.get_pipe_transport(0).write(data)
|
||||
|
||||
def stdout_data_received(self, data):
|
||||
super(GDBClientProcess, self).stdout_data_received(data)
|
||||
super().stdout_data_received(data)
|
||||
self._handle_error(data)
|
||||
# go to init break automatically
|
||||
if self.INIT_COMPLETED_BANNER.encode() in data:
|
||||
@@ -170,7 +170,7 @@ class GDBClientProcess(DebugClientProcess):
|
||||
self._target_is_running = True
|
||||
|
||||
def stderr_data_received(self, data):
|
||||
super(GDBClientProcess, self).stderr_data_received(data)
|
||||
super().stderr_data_received(data)
|
||||
self._handle_error(data)
|
||||
|
||||
def _handle_error(self, data):
|
||||
|
||||
@@ -30,7 +30,7 @@ class DebugServerProcess(DebugBaseProcess):
|
||||
STD_BUFFER_SIZE = 1024
|
||||
|
||||
def __init__(self, debug_config):
|
||||
super(DebugServerProcess, self).__init__()
|
||||
super().__init__()
|
||||
self.debug_config = debug_config
|
||||
self._ready = False
|
||||
self._std_buffer = {"out": b"", "err": b""}
|
||||
@@ -134,7 +134,7 @@ class DebugServerProcess(DebugBaseProcess):
|
||||
return self._ready
|
||||
|
||||
def stdout_data_received(self, data):
|
||||
super(DebugServerProcess, self).stdout_data_received(
|
||||
super().stdout_data_received(
|
||||
escape_gdbmi_stream("@", data) if is_gdbmi_mode() else data
|
||||
)
|
||||
self._std_buffer["out"] += data
|
||||
@@ -142,7 +142,7 @@ class DebugServerProcess(DebugBaseProcess):
|
||||
self._std_buffer["out"] = self._std_buffer["out"][-1 * self.STD_BUFFER_SIZE :]
|
||||
|
||||
def stderr_data_received(self, data):
|
||||
super(DebugServerProcess, self).stderr_data_received(data)
|
||||
super().stderr_data_received(data)
|
||||
self._std_buffer["err"] += data
|
||||
self._check_ready_by_pattern(self._std_buffer["err"])
|
||||
self._std_buffer["err"] = self._std_buffer["err"][-1 * self.STD_BUFFER_SIZE :]
|
||||
|
||||
Reference in New Issue
Block a user