Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

outgoing_http: Fix type annotations.

Anders Kaseorg7f0381d4c7f1
diff --git a/pyproject.toml b/pyproject.toml
index 628a0dbea66..3b34dec8ae6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -100,7 +100,6 @@ module = [
"tornado.*",
"twitter.*",
"two_factor.*",
- "urllib3.*",
"zxcvbn.*",
]
ignore_missing_imports = true
diff --git a/zerver/lib/outgoing_http.py b/zerver/lib/outgoing_http.py
index d0fc93dae3f..dbeed927741 100644
--- a/zerver/lib/outgoing_http.py
+++ b/zerver/lib/outgoing_http.py
@@ -1,7 +1,6 @@
from typing import Any, Dict, Optional
import requests
-from urllib3 import HTTPResponse
class OutgoingSession(requests.Session):
@@ -18,12 +17,12 @@ class OutgoingHTTPAdapter(requests.adapters.HTTPAdapter):
role: str
timeout: int
- def __init__(self, role: str, timeout: int, *args: Any, **kwargs: Any) -> None:
+ def __init__(self, role: str, timeout: int) -> None:
self.role = role
self.timeout = timeout
- super().__init__(*args, **kwargs)
+ super().__init__()
- def send(self, *args: Any, **kwargs: Any) -> HTTPResponse:
+ def send(self, *args: Any, **kwargs: Any) -> requests.Response:
if kwargs.get("timeout") is None:
kwargs["timeout"] = self.timeout
return super().send(*args, **kwargs)