Skip to content

Commit

Permalink
setup.py: Define FileNotFoundError as IOError on Py2
Browse files Browse the repository at this point in the history
FileNotFoundError doesn't exist on Python 2.7.
Its equivalent would be IOError in this context.
Should fix build on Python 2.7
  • Loading branch information
vphilippon committed Apr 25, 2019
1 parent d79a5fa commit 948db64
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions setup.py
Expand Up @@ -9,6 +9,11 @@
from distutils.errors import DistutilsPlatformError, DistutilsExecError
from _pyrsistent_version import __version__

try:
FileNotFoundError
except NameError: # Python 2
FileNotFoundError = IOError


readme_path = os.path.join(os.path.dirname(__file__), 'README.rst')
with codecs.open(readme_path, encoding='utf8') as f:
Expand Down

0 comments on commit 948db64

Please sign in to comment.