diff options
author | Guido van Rossum <guido@python.org> | 2003-02-27 20:14:51 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2003-02-27 20:14:51 (GMT) |
commit | 68468eba635570400f607e140425a222018e56f9 (patch) | |
tree | 2176c8822392383a88caa0a2209a1d2f3446d45c /Lib/urllib.py | |
parent | f389c7727362321a91dbaff13b7e1cef6cbaa3d8 (diff) | |
download | cpython-68468eba635570400f607e140425a222018e56f9.zip cpython-68468eba635570400f607e140425a222018e56f9.tar.gz cpython-68468eba635570400f607e140425a222018e56f9.tar.bz2 |
Get rid of many apply() calls.
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r-- | Lib/urllib.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index 4dd76df..24667ec 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -293,7 +293,7 @@ class URLopener: h.putrequest('GET', selector) if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) - for args in self.addheaders: apply(h.putheader, args) + for args in self.addheaders: h.putheader(*args) h.endheaders() if data is not None: h.send(data) @@ -371,7 +371,7 @@ class URLopener: h.putrequest('GET', selector) if auth: h.putheader('Authorization: Basic %s' % auth) if realhost: h.putheader('Host', realhost) - for args in self.addheaders: apply(h.putheader, args) + for args in self.addheaders: h.putheader(*args) h.endheaders() if data is not None: h.send(data) @@ -541,7 +541,7 @@ class FancyURLopener(URLopener): """Derived class with handlers for errors we can handle (perhaps).""" def __init__(self, *args, **kwargs): - apply(URLopener.__init__, (self,) + args, kwargs) + URLopener.__init__(self, *args, **kwargs) self.auth_cache = {} self.tries = 0 self.maxtries = 10 @@ -804,7 +804,7 @@ class addclosehook(addbase): def close(self): addbase.close(self) if self.closehook: - apply(self.closehook, self.hookargs) + self.closehook(*self.hookargs) self.closehook = None self.hookargs = None |