Commits

agronholm  committed effa628

Fixed urllib2 client constructor

  • Participants
  • Parent commits 9390c7a

Comments (0)

Files changed (1)

File pyhttprpc/client/urllib2_client.py

     def __init__(self, url, **opts):
         BaseRPCClient.__init__(self, url, **opts)
 
+        self.opener = build_opener(*self._get_handlers(opts))
+
         initargs = inspect.getargspec(self.opener.open).args
         self._urlopen_opts = {}
         if 'timeout' in initargs:
             self._urlopen_opts['timeout'] = self.timeout or None
 
-        self.opener = build_opener(*self._get_handlers())
-
     def _get_handlers(self, opts):
         handlers = []
         if self.scheme == 'http':