simplify proxy code a bit

This commit is contained in:
Ralf Schmitt 2012-08-22 22:02:10 +02:00
parent bd0a539ee0
commit c0405d820c
1 changed files with 5 additions and 6 deletions

View File

@ -94,13 +94,12 @@ def find_updates(pkgset, stable_only=True):
if http_proxy_url: if http_proxy_url:
http_proxy_spec = urllib.splithost(urllib.splittype(http_proxy_url)[1])[0] http_proxy_spec = urllib.splithost(urllib.splittype(http_proxy_url)[1])[0]
transport = ProxiedTransport()
p = ProxiedTransport() transport.set_proxy(http_proxy_spec)
p.set_proxy(http_proxy_spec)
pypi = Server("http://pypi.python.org/pypi/", transport=p)
else: else:
pypi = Server("http://pypi.python.org/pypi/") transport = None
pypi = Server("http://pypi.python.org/pypi/", transport=transport)
pkgname2latest = {} pkgname2latest = {}