numberoverzero / bottom

asyncio-based rfc2812-compliant IRC Client
http://bottom-docs.readthedocs.io
MIT License
75 stars 23 forks source link

Compatibility with 3.12+ #64

Open Cheaterman opened 2 months ago

Cheaterman commented 2 months ago

https://github.com/numberoverzero/bottom/blob/a54ab2390bc33b4cfa72d65f0093ace6ed15a0ef/bottom/client.py#L54

This for example won't work, and there's other issues like this

For the former, remove the kwarg ; for the latter, something like

        wrapped = func

        if not asyncio.iscoroutinefunction(wrapped):
            _original_wrapped = wrapped

            @functools.wraps(_original_wrapped)
            async def wrapper(*args, **kwargs):
                _original_wrapped(*args, **kwargs)

            wrapped = wrapper