Raise IOError when path doesn't exists
This commit is contained in:
parent
55013a04dd
commit
fb53241420
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user