Skip to content

[BUG]: Error running on versions of Python < 3.8 #4

@bsharper

Description

@bsharper

Description of the bug

When attempting to import this library on Python lower than 3.8, the following error will appear:

ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)

This error was reproduced on 2 of my Raspberry Pis running Raspbian GNU/Linux 10 (buster).
There is fortunately a trivial fix. In utils.py change

from typing import Dict, Literal

to

from typing import Dict
from typing_extensions import Literal

Or put the current Literal import code in a try / except with the exception importing the 2nd way. I could make a pull request but figured this would be easier.

Steps To Reproduce

On Python < 3.8:

pip install sponsorblock
python -c "import sponsorblock"

Additional Information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions