Skip to content

Commit

Permalink
mnt: catch AttributeError explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
zerothi committed Oct 11, 2022
1 parent d4e00f3 commit 5fe4353
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sisl/io/sile.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,14 @@ def __init__(self, filename, *args, **kwargs):

try:
filename = Path(filehandle.name)
except:
except AttributeError:
# this is not optimal, it will be the current directory, but one should not be able
# to write to it
filename = Path()

try:
mode = filehandle.mode
except:
except AttributeError:
# a StringIO will always be able to read *and* write
# to its buffer
mode = "rw"
Expand Down

0 comments on commit 5fe4353

Please sign in to comment.