Skip to content

Commit

Permalink
do not initialize transport for nonblocking calls
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Jun 4, 2024
1 parent ed959b3 commit 1baa479
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ahk/_async/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ async def function_call(
blocking: bool = True,
engine: Optional[AsyncAHK[Any]] = None,
) -> Any:
if not self._started:
if not self._started and blocking:
with warnings.catch_warnings(record=True) as caught_warnings:
await self.init()
if caught_warnings:
Expand Down
2 changes: 1 addition & 1 deletion ahk/_sync/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def function_call(
blocking: bool = True,
engine: Optional[AHK[Any]] = None,
) -> Any:
if not self._started:
if not self._started and blocking:
with warnings.catch_warnings(record=True) as caught_warnings:
self.init()
if caught_warnings:
Expand Down

0 comments on commit 1baa479

Please sign in to comment.