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

Check PIL support for tostring and fromstring #3690

Merged
merged 1 commit into from
Jan 15, 2021

Conversation

sirbiscuit
Copy link
Contributor

The current code checks whether the methods tostring and fromstring
exist in a PIL image object like this:

getattr(image, 'tobytes', image.tostring)

This code raises an exception when image doesn't have the tostring
method. That seems to be the case in recent pillow versions!

Check if the tostring or tobytes method exists (in this order).

This is related to #644.

Reference Issue

What does this implement/fix? Explain your changes.

Any other comments?

The current code checks whether the methods tostring and fromstring
exist in a PIL image object like this:

  getattr(image, 'tobytes', image.tostring)

This code raises an exception when image doesn't have the tostring
method. That seems to be the case in recent pillow versions!

Check if the tostring or tobytes method exists (in this order).

This is related to rdkit#644.
@greglandrum greglandrum added this to the 2020_09_4 milestone Jan 15, 2021
@greglandrum
Copy link
Member

Thanks for the fix @sirbiscuit!

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

Successfully merging this pull request may close these issues.

None yet

2 participants