From: Raymond Hettinger Date: Sat, 5 Feb 2005 14:37:06 +0000 (+0000) Subject: SF patch #1028908 X-Git-Tag: v2.5a0~2056 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f7bf02ded533421a0e231c425ac7ff08b8efc589;p=thirdparty%2FPython%2Fcpython.git SF patch #1028908 (John J Lee) Minor code clarification and simplification. --- diff --git a/Lib/urllib2.py b/Lib/urllib2.py index a4046d30c237..ae2ab17dab1d 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