PythonistaGuild / TwitchIO

An Async Bot/API wrapper for Twitch made in Python.
https://twitchio.dev
MIT License
791 stars 163 forks source link

Python 3.10 compatibility #251

Closed nkukard closed 2 years ago

nkukard commented 2 years ago

It looks like the loop parameter was removed from Event() in Python 3.10, affecting ext/pubsub/websocket.py line 75

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/twitchio/client.py", line 193, in wrapped
    await func(*args)
  File "/home/nkukard/Development/twitch-kendra-bot/kendrabot/bot.py", line 103, in event_ready
    await self.pubsub.subscribe_topics(topics)
  File "/usr/lib/python3.10/site-packages/twitchio/ext/pubsub/pool.py", line 67, in subscribe_topics
    node = PubSubWebsocket(self.client, max_topics=self._max_connection_topics)
  File "/usr/lib/python3.10/site-packages/twitchio/ext/pubsub/websocket.py", line 75, in __init__
    self.timeout = asyncio.Event(loop=self.client.loop)
  File "/usr/lib/python3.10/asyncio/locks.py", line 167, in __init__
    super().__init__(loop=loop)
  File "/usr/lib/python3.10/asyncio/mixins.py", line 17, in __init__
    raise TypeError(
TypeError: As of 3.10, the *loop* parameter was removed from Event() since it is no longer necessary