Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example in README.MD does not work #22

Open
schperplata opened this issue Sep 3, 2023 · 0 comments
Open

Example in README.MD does not work #22

schperplata opened this issue Sep 3, 2023 · 0 comments

Comments

@schperplata
Copy link

Example in README, aioserial equivalence chapter, does not work.

Here is the traceback:

...test_aiserial.py:16: DeprecationWarning: There is no current event loop
  asyncio.run(asyncio.gather(read_and_print(aioserial_instance), aioserial_instance.write_async(b"Hello, World!\n")))
Traceback (most recent call last):
  File "...test_aiserial.py", line 16, in <module>
    asyncio.run(asyncio.gather(read_and_print(aioserial_instance), aioserial_instance.write_async(b"Hello, World!\n")))
  File "Python311\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "Python311\Lib\asyncio\runners.py", line 89, in run
    raise ValueError("a coroutine was expected, got {!r}".format(coro))
ValueError: a coroutine was expected, got <_GatheringFuture pending>
sys:1: RuntimeWarning: coroutine 'AioSerial.write_async' was never awaited
sys:1: RuntimeWarning: coroutine 'read_and_print' was never awaited

VSCode Pylance static analysis reports:

Argument of type "Future[tuple[None, int]]" cannot be assigned to parameter "main" of type "Coroutine[Any, Any, _T@run]" in function "run"
  "Future[tuple[None, int]]" is incompatible with "Coroutine[Any, Any, _T@run]"Pylance[reportGeneralTypeIssues](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportGeneralTypeIssues)

Windows 10, 64 bit
Python 3.11.0
aioserial==1.3.1
pyserial==3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant