Skip to content

Commit

Permalink
Merge pull request #185 from apriha/hotfix/fix-formatting
Browse files Browse the repository at this point in the history
Ruff format fix
  • Loading branch information
apriha authored Dec 4, 2024
2 parents c702fa6 + b36b462 commit a47f1d4
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/snps/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,18 +767,15 @@ def _download_file(self, url, filename, compress=False, timeout=30):
try:
# get file if it hasn't already been downloaded
# http://stackoverflow.com/a/7244263
with urllib.request.urlopen(
url, timeout=timeout
) as response, atomic_write(
destination, mode="wb", overwrite=True
) as f:
self._print_download_msg(destination)
data = response.read() # a `bytes` object

if compress:
self._write_data_to_gzip(f, data)
else:
f.write(data)
with urllib.request.urlopen(url, timeout=timeout) as response:
with atomic_write(destination, mode="wb", overwrite=True) as f:
self._print_download_msg(destination)
data = response.read() # a `bytes` object

if compress:
self._write_data_to_gzip(f, data)
else:
f.write(data)
except urllib.error.URLError as err:
logger.warning(err)
destination = ""
Expand Down

0 comments on commit a47f1d4

Please sign in to comment.