Skip to content

Commit

Permalink
[helpers] Fix get() call in download_file() (#3825)
Browse files Browse the repository at this point in the history
get() is a function and not an object with __enter__ (aka context manager)
  • Loading branch information
krrishnarraj committed Nov 15, 2021
1 parent b61de2e commit d3bc0eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/poetry/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d3bc0eb

Please sign in to comment.