commit 483dc625224f2ac68fc5d785e216ecdce5463862 from: Jelmer Vernooij date: Fri Jan 13 19:47:07 2023 UTC Fix deprecation warning re HTTPResponse.getheader(). commit - 4d5eee3d97909014e741e24320ea3df826a5e185 commit + 483dc625224f2ac68fc5d785e216ecdce5463862 blob - 6757a856597c670df24c96956f0d6caf3ccc7323 blob + a70755dd8c1a14357cc221578d15374a9c35c6b8 --- dulwich/client.py +++ dulwich/client.py @@ -2266,15 +2266,15 @@ class Urllib3HttpGitClient(AbstractHttpGitClient): if resp.status == 404: raise NotGitRepository() if resp.status == 401: - raise HTTPUnauthorized(resp.getheader("WWW-Authenticate"), url) + raise HTTPUnauthorized(resp.headers.get("WWW-Authenticate"), url) if resp.status == 407: - raise HTTPProxyUnauthorized(resp.getheader("Proxy-Authenticate"), url) + raise HTTPProxyUnauthorized(resp.headers.get("Proxy-Authenticate"), url) if resp.status != 200: raise GitProtocolError( "unexpected http resp %d for %s" % (resp.status, url) ) - resp.content_type = resp.getheader("Content-Type") + resp.content_type = resp.headers.get("Content-Type") # Check if geturl() is available (urllib3 version >= 1.23) try: resp_url = resp.geturl()