Skip to content

Commit

Permalink
Merge pull request #25 from DHI/filenotfounderror
Browse files Browse the repository at this point in the history
FileNotFoundError is more specific than Exception
  • Loading branch information
JesperGr authored Sep 9, 2024
2 parents f35d4c5 + a752b7a commit 6ebbb1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mikecore/DfsFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def Open(self, filename, mode = DfsFileMode.Read, parameters=None):
self.Close()

if (not os.path.isfile(filename)):
raise Exception("File not found {}".format(filename))
raise FileNotFoundError("File not found {}".format(filename))

# Check if trying to edit a read-only file.
if ((mode == DfsFileMode.Edit or mode == DfsFileMode.Append)
Expand Down

0 comments on commit 6ebbb1a

Please sign in to comment.