Skip to content

Commit a0955bc

Browse files
committed
wrap in try/except
1 parent 77f8008 commit a0955bc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

fortls/parse_fortran.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -872,9 +872,13 @@ def load_from_disk(self) -> tuple[str | None, bool | None]:
872872
return "Could not read/decode file", None
873873
else:
874874
# Check if files are the same
875-
hash = hashlib.md5(
876-
contents.encode("utf-8"), usedforsecurity=False
877-
).hexdigest()
875+
try:
876+
hash = hashlib.md5(
877+
contents.encode("utf-8"), usedforsecurity=False
878+
).hexdigest()
879+
except:
880+
hash = hashlib.md5(contents.encode("utf-8")).hexdigest()
881+
878882
if hash == self.hash:
879883
return None, False
880884

0 commit comments

Comments
 (0)