Remove Python 2 code
This commit is contained in:
@@ -21,9 +21,9 @@ import time
|
||||
from platformio import fs
|
||||
from platformio.compat import (
|
||||
WINDOWS,
|
||||
create_task,
|
||||
aio_create_task,
|
||||
aio_get_running_loop,
|
||||
get_locale_encoding,
|
||||
get_running_loop,
|
||||
string_types,
|
||||
)
|
||||
from platformio.proc import get_pythonexe_path
|
||||
@@ -83,7 +83,7 @@ class DebugBaseProcess:
|
||||
for pipe in ("stdin", "stdout", "stderr"):
|
||||
if pipe not in kwargs:
|
||||
kwargs[pipe] = subprocess.PIPE
|
||||
loop = get_running_loop()
|
||||
loop = aio_get_running_loop()
|
||||
await loop.subprocess_exec(
|
||||
lambda: DebugSubprocessProtocol(self), *args, **kwargs
|
||||
)
|
||||
@@ -99,10 +99,10 @@ class DebugBaseProcess:
|
||||
self.transport = transport
|
||||
|
||||
def connect_stdin_pipe(self):
|
||||
self._stdin_read_task = create_task(self._read_stdin_pipe())
|
||||
self._stdin_read_task = aio_create_task(self._read_stdin_pipe())
|
||||
|
||||
async def _read_stdin_pipe(self):
|
||||
loop = get_running_loop()
|
||||
loop = aio_get_running_loop()
|
||||
if WINDOWS:
|
||||
while True:
|
||||
self.stdin_data_received(
|
||||
|
||||
@@ -21,7 +21,7 @@ import time
|
||||
|
||||
from platformio import fs, proc, telemetry, util
|
||||
from platformio.cache import ContentCache
|
||||
from platformio.compat import get_running_loop, hashlib_encode_data, is_bytes
|
||||
from platformio.compat import aio_get_running_loop, hashlib_encode_data, is_bytes
|
||||
from platformio.debug import helpers
|
||||
from platformio.debug.exception import DebugInvalidOptionsError
|
||||
from platformio.debug.initcfgs import get_gdb_init_config
|
||||
@@ -191,7 +191,7 @@ class DebugClientProcess(
|
||||
def _auto_exec_continue(self):
|
||||
auto_exec_delay = 0.5 # in seconds
|
||||
if self._last_activity > (time.time() - auto_exec_delay):
|
||||
get_running_loop().call_later(0.1, self._auto_exec_continue)
|
||||
aio_get_running_loop().call_later(0.1, self._auto_exec_continue)
|
||||
return
|
||||
|
||||
if not self.debug_options["init_break"] or self._target_is_running:
|
||||
|
||||
Reference in New Issue
Block a user