From f7bf02ded533421a0e231c425ac7ff08b8efc589 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 5 Feb 2005 14:37:06 +0000 Subject: SF patch #1028908 (John J Lee) Minor code clarification and simplification. --- Lib/urllib2.py | 9 ++++++--- 1 file 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 -- cgit v0.12