Skip to content
New issue

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

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

Already on GitHub? # to your account

Makes toyplot work with python 3.10 due to an API change in collections #202

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

StuntsPT
Copy link
Contributor

Using toyplot with python 3.10 was causing the following exception:

File "/home/francisco/.local/lib/python3.10/site-packages/toyplot/color.py", line 200, in broadcast
    if isinstance(colors, collections.Sequence):
AttributeError: module 'collections' has no attribute 'Sequence'

Investigating the issue led me to realize this was due to a change in the collections module.
The class Sequence was moved from collections.Sequence to collections.abc.Sequence.
This PR fixes the issue by calling the Sequence class from the "new" module.
I did not test it, but according to the documentation, this should be compatible with python 3.3 and up.

Best,

Francisco

@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.969% when pulling 857778a on StuntsPT:main into c294153 on sandialabs:main.

@tshead2 tshead2 merged commit a763d09 into sandialabs:main Feb 18, 2022
@tshead2
Copy link
Member

tshead2 commented Feb 18, 2022

@StuntsPT - great job tracking this down. Many thanks!

Tim

@StuntsPT
Copy link
Contributor Author

Happy to help!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants