Browse Source

Fix NameError when encountering errors during HTTP operation. Fixes #1208

Jelmer Vernooij 1 year ago
parent
commit
029885f794
2 changed files with 4 additions and 0 deletions
  1. 3 0
      NEWS
  2. 1 0
      dulwich/client.py

+ 3 - 0
NEWS

@@ -1,5 +1,8 @@
 0.21.7	UNRELEASED
 
+ * Fix NameError when encountering errors during HTTP operation.
+   (Jelmer Vernooij, #1208)
+
 0.21.6	2023-09-02
 
  * index: Handle different stages of conflicted paths.

+ 1 - 0
dulwich/client.py

@@ -2225,6 +2225,7 @@ class Urllib3HttpGitClient(AbstractHttpGitClient):
         return urljoin(self._base_url, path).rstrip("/") + "/"
 
     def _http_request(self, url, headers=None, data=None):
+        import urllib3.exceptions
         req_headers = self.pool_manager.headers.copy()
         if headers is not None:
             req_headers.update(headers)