Skip to content

Commit f592add

Browse files
committed
fix some code quality quirks
1 parent af303fb commit f592add

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

robotcode/jsonrpc2/server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,6 @@ async def start_tcp(self, host: Optional[str] = None, port: int = 0) -> None:
210210
def start_pipe(self, pipe_name: Optional[str]) -> None:
211211
from typing import TYPE_CHECKING
212212

213-
if TYPE_CHECKING:
214-
from asyncio.streams import StreamReaderProtocol
215-
from asyncio.windows_events import ProactorEventLoop
216-
217213
if pipe_name is None:
218214
raise ValueError("pipe name missing.")
219215

@@ -223,6 +219,10 @@ def start_pipe(self, pipe_name: Optional[str]) -> None:
223219
# check if we are on windows and using the ProactorEventLoop, to use the undocumented
224220
# create_pipe_connection method
225221
if sys.platform == "win32" and hasattr(self.loop, "create_pipe_connection"):
222+
if TYPE_CHECKING:
223+
from asyncio.streams import StreamReaderProtocol
224+
from asyncio.windows_events import ProactorEventLoop
225+
226226
self.loop.run_until_complete(
227227
cast("ProactorEventLoop", self.loop).create_pipe_connection(
228228
lambda: cast("StreamReaderProtocol", self.create_protocol()), pipe_name

robotcode/language_server/robotframework/diagnostics/analyzer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ async def run(self) -> List[Diagnostic]:
5454
return self._results
5555

5656
async def visit(self, node: ast.AST) -> None:
57-
from robot.variables.search import contains_variable
5857
from robot.parsing.lexer.tokens import Token as RobotToken
5958
from robot.parsing.model.statements import KeywordCall
59+
from robot.variables.search import contains_variable
6060

6161
self.node_stack.append(node)
6262
try:

0 commit comments

Comments
 (0)