Skip to content
Snippets Groups Projects
Commit c0260960 authored by Eva Schiffer's avatar Eva Schiffer Committed by GitHub
Browse files

Merge pull request #16 from adesmet-ssec/open-exceptions

Raise built-in open exceptions if file inaccessible
parents 03e6c161 5718694e
No related branches found
No related tags found
No related merge requests found
......@@ -1355,6 +1355,13 @@ class jpss_adl(object):
def open(pathname, allowWrite=False):
suffix = os.path.splitext(pathname)[1][1:].lower()
# Just test we can open the file so we automatically raise a suitable
# error if we can't access it.
from __builtin__ import open
with open(pathname):
pass
if (not suffix) or (suffix not in globals()):
# this ican be used to specify a format on the command line by setting the
# environment variable FORMAT, for example:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment