]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#4496: remove misleading comment and note that self.handlers is obsolete.
authorR. David Murray <rdmurray@bitdance.com>
Thu, 23 Dec 2010 19:44:49 +0000 (19:44 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Thu, 23 Dec 2010 19:44:49 +0000 (19:44 +0000)
self.handlers is still used in one urllib2 test, but not by the code iteslf.

Lib/urllib/request.py

index 17936ee94848d20b42c5257b373a67445624380f..a88bc99d1d1ab72078a3c134f8ea65b5afd19852 100644 (file)
@@ -275,8 +275,9 @@ class OpenerDirector:
     def __init__(self):
         client_version = "Python-urllib/%s" % __version__
         self.addheaders = [('User-agent', client_version)]
-        # manage the individual handlers
+        # self.handlers is retained only for backward compatibility
         self.handlers = []
+        # manage the individual handlers
         self.handle_open = {}
         self.handle_error = {}
         self.process_response = {}
@@ -326,8 +327,6 @@ class OpenerDirector:
             added = True
 
         if added:
-            # the handlers must work in an specific order, the order
-            # is specified in a Handler attribute
             bisect.insort(self.handlers, handler)
             handler.add_parent(self)