Use OSError instead of the IOError alias (PEP 3151)
The default second argument to open() is "r", so this is removed. This one could be controversial, but the contexts where this is done it is clear the file is being read.
The only manual edit is to rephrase an exception message in src/rasterstats/main.py
This was mostly automated using pyupgrade, which does several things mostly related to Python 2 to 3 upgrades:
from __future__
importsyield from
statement (PEP 380)OSError
instead of theIOError
alias (PEP 3151)open()
is"r"
, so this is removed. This one could be controversial, but the contexts where this is done it is clear the file is being read.The only manual edit is to rephrase an exception message in src/rasterstats/main.py