Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasteuwen committed Dec 10, 2021
1 parent 41208ea commit bbdc4ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions direct/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ def download_url(

# download the file
try:
logger.info("Downloading " + url + " to " + fpath)
logger.info(f"Downloading {url} to {fpath}")
_urlretrieve(url, fpath)
except (urllib.error.URLError, OSError) as e: # type: ignore[attr-defined]
if url[:5] == "https":
url = url.replace("https:", "http:")
logger.info("Failed download. Trying https -> http instead. Downloading " + url + " to " + fpath)
logger.info(f"Failed download. Trying https -> http instead. Downloading {url} to {fpath}")
_urlretrieve(url, fpath)
else:
raise e
Expand Down

0 comments on commit bbdc4ca

Please sign in to comment.