[Python-checkins] r81945 - python/trunk/Doc/library/doctest.rst

nick.coghlan python-checkins at python.org
Sat Jun 12 15:45:37 CEST 2010


Author: nick.coghlan
Date: Sat Jun 12 15:45:37 2010
New Revision: 81945

Log:
Backport a fix from Py3k for a potentially misleading example

Modified:
   python/trunk/Doc/library/doctest.rst

Modified: python/trunk/Doc/library/doctest.rst
==============================================================================
--- python/trunk/Doc/library/doctest.rst	(original)
+++ python/trunk/Doc/library/doctest.rst	Sat Jun 12 15:45:37 2010
@@ -576,13 +576,13 @@
    both these variations will work regardless of whether the test is run under
    Python 2.7 or Python 3.2 (or later versions):
 
-      >>> raise ValueError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
+      >>> raise CustomError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
       Traceback (most recent call last):
-      ValueError: message
+      CustomError: message
 
-      >>> raise ValueError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
+      >>> raise CustomError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
       Traceback (most recent call last):
-      builtin.ValueError: message
+      my_module.CustomError: message
 
    Note that :const:`ELLIPSIS` can also be used to ignore the
    details of the exception message, but such a test may still fail based


More information about the Python-checkins mailing list