]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF patch #1028908
authorRaymond Hettinger <python@rcn.com>
Sat, 5 Feb 2005 14:37:06 +0000 (14:37 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 5 Feb 2005 14:37:06 +0000 (14:37 +0000)
(John J Lee)

Minor code clarification and simplification.

Lib/urllib2.py

index a4046d30c237fccf0286459b5f4586f69b39d78d..ae2ab17dab1d45c0bf4e5da93c970ecca11a8e99 100644 (file)
@@ -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