]> granicus.if.org Git - python/commitdiff
bpo-32586: Fix code example in urllib2's doc (GH-5238)
authorPablo Galindo <Pablogsal@gmail.com>
Fri, 19 Jan 2018 00:16:13 +0000 (00:16 +0000)
committerMariatta <Mariatta@users.noreply.github.com>
Fri, 19 Jan 2018 00:16:13 +0000 (16:16 -0800)
It should be `urllib2.URLError` instead of just `URLError`.

Doc/howto/urllib2.rst

index d697c216d8c36002692e72075bc81e445fef0a5a..ce6394859d57c1bcf42d386a81daf745b1e2f8fd 100644 (file)
@@ -203,7 +203,7 @@ e.g. ::
 
     >>> req = urllib2.Request('http://www.pretend_server.org')
     >>> try: urllib2.urlopen(req)
-    ... except URLError as e:
+    ... except urllib2.URLError as e:
     ...    print e.reason   #doctest: +SKIP
     ...
     (4, 'getaddrinfo failed')