]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix for Issue7570: Error in urllib2 example.
authorSenthil Kumaran <orsenthil@gmail.com>
Thu, 24 Dec 2009 02:18:14 +0000 (02:18 +0000)
committerSenthil Kumaran <orsenthil@gmail.com>
Thu, 24 Dec 2009 02:18:14 +0000 (02:18 +0000)
Doc/library/urllib2.rst

index 3e75f8c965a4e6ce3e860d6d99a4f3a0c726dd21..cf889cc63f70b2b54c79bcf7486598718fd4a1a6 100644 (file)
@@ -945,10 +945,10 @@ programmatically-supplied proxy URLs, and adds proxy authorization support with
 :class:`ProxyBasicAuthHandler`. ::
 
    proxy_handler = urllib2.ProxyHandler({'http': 'http://www.example.com:3128/'})
-   proxy_auth_handler = urllib2.HTTPBasicAuthHandler()
+   proxy_auth_handler = urllib2.ProxyBasicAuthHandler()
    proxy_auth_handler.add_password('realm', 'host', 'username', 'password')
 
-   opener = build_opener(proxy_handler, proxy_auth_handler)
+   opener = urllib2.build_opener(proxy_handler, proxy_auth_handler)
    # This time, rather than install the OpenerDirector, we use it directly:
    opener.open('http://www.example.com/login.html')