mafic icon indicating copy to clipboard operation
mafic copied to clipboard

Type Issue in typings/misc.py - Not 3.8 compatible (reported from mafic support discord)

Open dlchamp opened this issue 2 years ago • 0 comments

Summary

Exception thrown when running mafic on python 3.8

Reproduction Steps

Import mafic while using Python 3.8

Minimal Reproducible Code

`import mafic`

Expected Results

No errors when running bot that includes Mafic

Actual Results

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/disnake/ext/commands/common_bot_base.py", line 452, in _load_from_module_spec
    spec.loader.exec_module(lib)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/project/mikis/modules/music/play.py", line 3, in <module>
    import mafic
  File "/usr/local/lib/python3.8/dist-packages/mafic/__init__.py", line 15, in <module>
    from .node import *
  File "/usr/local/lib/python3.8/dist-packages/mafic/node.py", line 32, in <module>
    from .typings import (
  File "/usr/local/lib/python3.8/dist-packages/mafic/typings/__init__.py", line 4, in <module>
    from .common import *
  File "/usr/local/lib/python3.8/dist-packages/mafic/typings/common.py", line 7, in <module>
    from .misc import PayloadWithGuild
  File "/usr/local/lib/python3.8/dist-packages/mafic/typings/misc.py", line 16, in <module>
    Coro = Coroutine[Any, Any, T]
TypeError: 'ABCMeta' object is not subscriptable

Lavalink Information

Not applicable

System Information

Reported in Tooty Town by multiple users. Users were using 3.8 and latest Mafic available on PyPi

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shown the entire traceback, if possible.

Additional Context

I'm not super familiar with types, but my Google-fu led me to the answer that from collections.abc import Coroutine is not compatible with Python 3.8.

So, pyproject should be updated to show that 3.9 is the minimum Python version that is supported and users having this issue should update or the import statement for Coroutine should be from typing import Coroutine instead to maintain 3.8 compatibility

dlchamp avatar Dec 07 '23 02:12 dlchamp