Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bsharper opened this issue Apr 15, 2022 · 4 comments
Closed

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

bsharper opened this issue Apr 15, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@bsharper
Copy link

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

@bsharper bsharper added the bug Something isn't working label Apr 15, 2022
@wasi-master
Copy link
Owner

Thanks for the issue. It's 2 AM here for me and I'm in my bed trying to sleep. I'll have to fix this in about 2-3 hours when I get up to eat my Sehri. Sorry for the delay but I really need to sleep and can't use my PC now

@bsharper
Copy link
Author

Ramadan Mubarak! I appreciate the quick reply. Sleep is much more important than fixing this bug that most people probably won't encounter.

Thank you for this project, overall it's been working beautifully.

@wasi-master
Copy link
Owner

Fixed in version 0.2.2

@bsharper
Copy link
Author

Confirmed fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants