spthm / asyncpio

An asynchronous Python client for pigpio.
The Unlicense
10 stars 6 forks source link

TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary #1

Closed mjkl-gh closed 1 year ago

mjkl-gh commented 2 years ago

Dear spthm,

First of all thanks for sharing this asyncio wrapper for pigpio.

I've run into some trouble using the EXAMPLES/Python/PCF8591_YL-40

When I run it I'm encountering the following error:

Traceback (most recent call last):
  File "/workspaces/as3935_async/asyncpio/EXAMPLES/Python/PCF8591_YL-40/PCF8591.py", line 67, in <module>
    asyncio.run(main())
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/workspaces/as3935_async/asyncpio/EXAMPLES/Python/PCF8591_YL-40/PCF8591.py", line 18, in main
    pi = asyncpio.pi()
  File "/home/vscode/.local/lib/python3.10/site-packages/asyncpio.py", line 5288, in __init__
    self.sl = _socklock()
  File "/home/vscode/.local/lib/python3.10/site-packages/asyncpio.py", line 934, in __init__
    self.l = asyncio.Lock(loop=loop)
  File "/usr/local/lib/python3.10/asyncio/locks.py", line 78, in __init__
    super().__init__(loop=loop)
  File "/usr/local/lib/python3.10/asyncio/mixins.py", line 17, in __init__
    raise TypeError(
TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary

I'm assuming something changed in python 3.10 that broke this example

spthm commented 1 year ago

@mjkl-gh thank you for opening this issue and the PR. Sorry it has been so long. I missed the GitHub notification and have not been using this repo for personal projects recently.