diff options
author | Raymond Hettinger <python@rcn.com> | 2005-02-05 14:37:06 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-02-05 14:37:06 (GMT) |
commit | f7bf02ded533421a0e231c425ac7ff08b8efc589 (patch) | |
tree | 4f3029bfbfd223be6f1cd4622e4f359a6028105f /Lib/urllib2.py | |
parent | bab4143348f2185c1a9a778a281ef84d46307842 (diff) | |
download | cpython-f7bf02ded533421a0e231c425ac7ff08b8efc589.zip cpython-f7bf02ded533421a0e231c425ac7ff08b8efc589.tar.gz cpython-f7bf02ded533421a0e231c425ac7ff08b8efc589.tar.bz2 |
SF patch #1028908
(John J Lee)
Minor code clarification and simplification.
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r-- | Lib/urllib2.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py index a4046d3..ae2ab17 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -304,10 +304,13 @@ class OpenerDirector: self.handle_error[protocol] = lookup elif condition == "open": kind = protocol - lookup = getattr(self, "handle_"+condition) - elif condition in ["response", "request"]: + lookup = self.handle_open + elif condition == "response": kind = protocol - lookup = getattr(self, "process_"+condition) + lookup = self.process_response + elif condition == "request": + kind = protocol + lookup = self.process_request else: continue |