10000 Catch exception for PyPy by gabriel-munteanu · Pull Request #8803 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Catch exception for PyPy #8803

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

Merged
merged 4 commits into from
Jun 27, 2017
Merged

Catch exception for PyPy #8803

merged 4 commits into from
Jun 27, 2017

Conversation

gabriel-munteanu
Copy link
Contributor
@gabriel-munteanu gabriel-munteanu commented Jun 26, 2017

PR Summary

Catch additional exception, specific for PyPy (equivalent of Python 2.7).
Because in python 2.7 obj.__doc__ is read only, PyPy will throw an TypeError exception(somehow equivalent to AttributeError from CPython)

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/whats_new.rst if major new feature
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

except AttributeError:
pass # cls.__doc__ is not writeable on Py2.
except (AttributeError, TypeError):
pass # cls.__doc__ is not writeable on Py2. TypeError occurs on PyPy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is now too long 😞

Copy link
Member
@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 to code, line wrapping needs to be fixed before it is merged.

@tacaswell
Copy link
Member

How close in Matplotlib to passing tests on pypy?

@gabriel-munteanu
Copy link
Contributor Author

Fixed comment line being too long.
I will respond to you tomorrow about tests passing on pypy, when I get to my workstation

@anntzer
Copy link
Contributor
anntzer commented Jun 26, 2017

You'll need to placate the style checker... see bottom of https://travis-ci.org/matplotlib/matplotlib/jobs/247129775

@gabriel-munteanu
Copy link
Contributor Author
gabriel-munteanu commented Jun 27, 2017

@tacaswell Here is a pastebin with output from running matplotlib tests on PyPy: https://pastebin.com/uVeGPwuk

L.E. I forgot to mention that I managed to compile matplotlib on PyPy with graphical backend provided by https://bitbucket.org/amauryfa/wxpython-cffi

@tacaswell
Copy link
Member

Skimming those issues a bunch of them look to be the pypy numpy not handling strings, a few places where we are checking refcounts, and one place where weakdicts work differently?

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Jun 27, 2017
@gabriel-munteanu
Copy link
Contributor Author
gabriel-munteanu comme 8000 nted Jun 27, 2017

Yes, you are right. From my point of view the results of the tests are quite good.

@anntzer
Copy link
Contributor
anntzer commented Jun 27, 2017

Can you force pypy to trigger the gc at some point (collecting everything that is unaccessible?) That would solve the weakdict issue; the getrefcount issue could probably be solved in a similar manner.

@anntzer anntzer merged commit 6c51037 into matplotlib:master Jun 27, 2017
@anntzer
Copy link
Contributor
anntzer commented Jun 27, 2017

thanks

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

Successfully merging this pull request may close these issues.

3 participants
0