Skip to content

Commit

Permalink
Update httpcore/_async/http_proxy.py
Browse files Browse the repository at this point in the history
Co-authored-by: Florimond Manca <[email protected]>
  • Loading branch information
cdeler and florimondmanca committed Oct 17, 2020
1 parent dfe46ac commit 74d87b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions httpcore/_async/http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ async def _tunnel_request(
socket=proxy_connection.socket,
)
await self._add_to_pool(connection, timeout)
except Exception:
except Exception as exc:
await proxy_connection.aclose()
raise
raise ProxyError(exc)

# Once the connection has been established we can send requests on
# it as normal.
Expand Down
4 changes: 2 additions & 2 deletions httpcore/_sync/http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ def _tunnel_request(
socket=proxy_connection.socket,
)
self._add_to_pool(connection, timeout)
except Exception:
except Exception as exc:
proxy_connection.close()
raise
raise ProxyError(exc)

# Once the connection has been established we can send requests on
# it as normal.
Expand Down

0 comments on commit 74d87b0

Please sign in to comment.