pip
pip copied to clipboard
Use strict optional checking in misc.py
Two things to change here:
First, I think the StreamWrapper code was buggy and it meant to patch an instance, not the class. It probably doesn't show up in practice because the encodings are the same.
Second, urlparse's hostname can be None. While this isn't likely, I
chose to put it in the signature rather than assert. I then need one
assert when something from it gets added to self.pip_trusted_origins
in another file. self.pip_trusted_origins
genuinely assumes that
hostname is not None, so the assert seemed fine.