From 3e152f8b20c75be89a73c4a9660346b7b29fb17d Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 25 Feb 2010 13:33:52 +0000 Subject: [PATCH] minor code refactoring --- lib/request/connect.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/request/connect.py b/lib/request/connect.py index 929d61568..23f62c615 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -96,10 +96,7 @@ class Connect: if not conf.proxy: if conf.hostname in ('localhost', '127.0.0.1'): proxyHandler = urllib2.ProxyHandler({}) - if proxyHandler: - multipartOpener = urllib2.build_opener(proxyHandler, multipartpost.MultipartPostHandler) - else: - multipartOpener = urllib2.build_opener(multipartpost.MultipartPostHandler) + multipartOpener = urllib2.build_opener(*(proxyHandler, multipartpost.MultipartPostHandler) if proxyHandler else multipartpost.MultipartPostHandler) conn = multipartOpener.open(url, multipart) page = conn.read() responseHeaders = conn.info()