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

Python 3.10 support #6

Open
sgtStrom opened this issue Mar 2, 2023 · 2 comments
Open

Python 3.10 support #6

sgtStrom opened this issue Mar 2, 2023 · 2 comments

Comments

@sgtStrom
Copy link

sgtStrom commented Mar 2, 2023

Hello!
Do you plan to add support of python 3.10? Your example won't run under python 3.10 neither using asyncio.run(main()) nor loop.run_until_complete(main()) syntax.

@frostspb
Copy link
Owner

frostspb commented Mar 2, 2023

Hello/ Try

loop = asyncio.get_event_loop()
tasks = [main()]
start = time.time()
loop.run_until_complete(asyncio.gather(*tasks))

@sgtStrom
Copy link
Author

sgtStrom commented Mar 3, 2023

Tried this:

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    tasks = [main()]
    loop.run_until_complete(asyncio.gather(*tasks))

but still got the same error. Here's the whole traceback:

/home/user/downloads/test_aio/run.py:27: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
/home/user/downloads/test_aio/run.py:30: DeprecationWarning: There is no current event loop
  loop.run_until_complete(asyncio.gather(*tasks))
Traceback (most recent call last):
  File "/home/user/downloads/test_aio/run.py", line 30, in <module>
    loop.run_until_complete(asyncio.gather(*tasks))
  File "/home/user/.pyenv/versions/3.10.6/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/user/downloads/test_aio/run.py", line 7, in main
    mk = await create_rosapi_connection(
  File "/home/user/downloads/test_aio/.venv/lib/python3.10/site-packages/aio_api_ros/creators.py", line 10, in create_rosapi_connection
    await connection.connect()
  File "/home/user/downloads/test_aio/.venv/lib/python3.10/site-packages/aio_api_ros/connection.py", line 42, in connect
    self.reader, self.writer = await asyncio.open_connection(
  File "/home/user/.pyenv/versions/3.10.6/lib/python3.10/asyncio/streams.py", line 47, in open_connection
    transport, _ = await loop.create_connection(
TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'loop'
Exception ignored in: <function ApiRosConnection.__del__ at 0x7f287c592320>
Traceback (most recent call last):
  File "/home/user/downloads/test_aio/.venv/lib/python3.10/site-packages/aio_api_ros/connection.py", line 36, in __del__
  File "/home/user/downloads/test_aio/.venv/lib/python3.10/site-packages/aio_api_ros/connection.py", line 100, in close
AttributeError: 'NoneType' object has no attribute 'close'

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

2 participants