Skip to content

Commit 47d03cc

Browse files
committed
Match MultiDomainBasicAuth.__call__ types with it's parent class
1 parent ad9bf38 commit 47d03cc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pip/_internal/network/auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
if TYPE_CHECKING:
3333
# Vendored libraries with type stubs
3434
from requests.auth import AuthBase, HTTPBasicAuth
35-
from requests.models import Request, Response
35+
from requests.models import PreparedRequest, Response
3636
from requests.utils import get_netrc_auth
3737
else:
3838
from pip._vendor.requests.auth import AuthBase, HTTPBasicAuth
@@ -443,8 +443,9 @@ def _get_url_and_credentials(
443443

444444
return url, username, password
445445

446-
def __call__(self, req: Request) -> Request:
446+
def __call__(self, req: PreparedRequest) -> PreparedRequest:
447447
# Get credentials for this request
448+
assert req.url is not None, f"{req} URL should not be None"
448449
url, username, password = self._get_url_and_credentials(req.url)
449450

450451
# Set the url of the request to the url without any credentials

0 commit comments

Comments
 (0)