Commit d3bc0eba by Krishnaraj Bhat Committed by GitHub

[helpers] Fix get() call in download_file() (#3825)

get() is a function and not an object with __enter__ (aka context manager)
parent b61de2e6
......@@ -98,13 +98,13 @@ def download_file(
get = requests.get if not session else session.get
with get(url, stream=True) as response:
response.raise_for_status()
response = get(url, stream=True)
response.raise_for_status()
with open(dest, "wb") as f:
for chunk in response.iter_content(chunk_size=chunk_size):
if chunk:
f.write(chunk)
with open(dest, "wb") as f:
for chunk in response.iter_content(chunk_size=chunk_size):
if chunk:
f.write(chunk)
def get_package_version_display_string(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment