]> granicus.if.org Git - python/commitdiff
Fudge - http.client doesn't exist in 2.7. Use Queue.Empty instead.
authorTim Peters <tim@python.org>
Wed, 4 Dec 2013 03:49:30 +0000 (21:49 -0600)
committerTim Peters <tim@python.org>
Wed, 4 Dec 2013 03:49:30 +0000 (21:49 -0600)
Lib/test/test_doctest.py

index c9de18897975c1a09f4912fcd53ee792e2bedf41..a58c4ae7a709595b9ee97bc30a1ce2d755098274 100644 (file)
@@ -1024,10 +1024,10 @@ IGNORE_EXCEPTION_DETAIL to normalize the modules between Python 2 and 3:
 
     >>> def f(x):
     ...     r'''
-    ...     >>> from http.client import HTTPException
-    ...     >>> raise HTTPException() #doctest: +IGNORE_EXCEPTION_DETAIL
+    ...     >>> from Queue import Empty
+    ...     >>> raise Empty() #doctest: +IGNORE_EXCEPTION_DETAIL
     ...     Traceback (most recent call last):
-    ...     foo.bar.HTTPException
+    ...     foo.bar.Empty
     ...     '''
     >>> test = doctest.DocTestFinder().find(f)[0]
     >>> doctest.DocTestRunner(verbose=False).run(test)
@@ -1037,10 +1037,10 @@ Note that a trailing colon doesn't matter either:
 
     >>> def f(x):
     ...     r'''
-    ...     >>> from http.client import HTTPException
-    ...     >>> raise HTTPException() #doctest: +IGNORE_EXCEPTION_DETAIL
+    ...     >>> from Queue import Empty
+    ...     >>> raise Empty() #doctest: +IGNORE_EXCEPTION_DETAIL
     ...     Traceback (most recent call last):
-    ...     foo.bar.HTTPException:
+    ...     foo.bar.Empty:
     ...     '''
     >>> test = doctest.DocTestFinder().find(f)[0]
     >>> doctest.DocTestRunner(verbose=False).run(test)