isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

Import ABC classes from collections.abc to prevent Deprecation warning #260

Closed jakobkogler closed 8 months ago

jakobkogler commented 5 years ago

This fixes #259.

Problem was: In Python 3.3 the abstract classes Sequence, Hashable and Iterable were moved to the collections.abc module. For backwards compatibility they were still accessable via the collections module. In Python 3.8 they want to break this backwards compatibility, so they added a Deprecation warning in Python 3.7, which crashes the program when the Pyth code runs with the --safe flag. Heroku upgraded their servers to Python 3.7 a few days ago, which introduced this error.

Notice: my quick fix only works in Python >= 3.3.

rtoal commented 8 months ago

Definitely worth merging in. I don't think that in 2024 any version of Python below 3.3 is still in use.

As mentioned in the linked issue, a working online interpreter is now hosted at https://pyth-docker.azurewebsites.net/, given that Heroku has, well, changed.