Skip to content

Cannot raise FileNotFoundError in python2 #5660

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

Closed
duncanmmacleod opened this issue Dec 11, 2015 · 1 comment
Closed

Cannot raise FileNotFoundError in python2 #5660

duncanmmacleod opened this issue Dec 11, 2015 · 1 comment
Assignees

Comments

@duncanmmacleod
Copy link
Contributor

An underlying problem (likely outside matplotlib) is causing a NameError when trying to raise a FileNotFoundError in python2:

...snippet...
  File "/home/duncan.macleod/.local/lib/python2.6/site-packages/matplotlib/dviread.py", line 150, in _read
    self._dispatch(byte)
  File "/home/duncan.macleod/.local/lib/python2.6/site-packages/matplotlib/dviread.py", line 233, in _dispatch
    self._fnt_def(k, c, s, d, a, l, n)
  File "/home/duncan.macleod/.local/lib/python2.6/site-packages/matplotlib/dviread.py", line 390, in _fnt_def
    raise FileNotFoundError("missing font metrics file: %s" % fontname)
NameError: global name 'FileNotFoundError' is not defined

Looks like there needs to be a six.PY3 check to define this exception if required.

@mdboom mdboom self-assigned this Dec 11, 2015
@mdboom mdboom closed this as completed in 157621b Dec 13, 2015
tacaswell added a commit that referenced this issue Dec 13, 2015
@tacaswell
Copy link
Member

Thanks for reporting this.

Please be aware that mpl2.0 onward will not support py2.6 and numpy will be dropping 2.6 in numpy 1.12.

tacaswell added a commit that referenced this issue Dec 13, 2015
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

No branches or pull requests

3 participants