File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/pip/_internal/network Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 32
32
if TYPE_CHECKING :
33
33
# Vendored libraries with type stubs
34
34
from requests .auth import AuthBase , HTTPBasicAuth
35
- from requests .models import Request , Response
35
+ from requests .models import PreparedRequest , Response
36
36
from requests .utils import get_netrc_auth
37
37
else :
38
38
from pip ._vendor .requests .auth import AuthBase , HTTPBasicAuth
@@ -443,8 +443,9 @@ def _get_url_and_credentials(
443
443
444
444
return url , username , password
445
445
446
- def __call__ (self , req : Request ) -> Request :
446
+ def __call__ (self , req : PreparedRequest ) -> PreparedRequest :
447
447
# Get credentials for this request
448
+ assert req .url is not None , f"{ req } URL should not be None"
448
449
url , username , password = self ._get_url_and_credentials (req .url )
449
450
450
451
# Set the url of the request to the url without any credentials
You can’t perform that action at this time.
0 commit comments