Skip to content

Commit

Permalink
Do not except BadGzipFile exception
Browse files Browse the repository at this point in the history
This exception is not supported for python 3.7 and lower.

Fixes: #132
  • Loading branch information
radomirbosak committed May 1, 2021
1 parent 78d5d81 commit 0cc3270
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion duden/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def function_wrapper(cache_key, cache=True, **kwargs):
try:
with gzip.open(full_path, 'rt', encoding='utf8') as f:
return f.read()
except (FileNotFoundError, gzip.BadGzipFile, IOError):
except (FileNotFoundError, IOError, EOFError):
pass

result = func(cache_key, **kwargs)
Expand Down

0 comments on commit 0cc3270

Please sign in to comment.