Raise IOError when path doesn't exists

This commit is contained in:
Florent Guiotte 2018-09-12 20:33:53 +02:00
parent 55013a04dd
commit fb53241420

View File

@ -47,6 +47,9 @@ def read(fname):
if not pname.exists():
raise IOError('File not found: {}'.format(pname))
if not pname.is_file():
raise IOError('{} is not a file'.format(pname))
gdl_data = gdal.Open(pname.as_posix())
if gdl_data.RasterCount == 1: