[Python-checkins] python/dist/src/Lib doctest.py,1.116,1.117

dcjim at users.sourceforge.net dcjim at users.sourceforge.net
Wed Oct 13 16:15:34 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19639/Lib

Modified Files:
	doctest.py 
Log Message:
Fixed a small bug. doctest didn't handle unicode docstrings containing
non-ascii characters.


Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- doctest.py	28 Sep 2004 05:50:57 -0000	1.116
+++ doctest.py	13 Oct 2004 14:15:31 -0000	1.117
@@ -962,7 +962,9 @@
                 if obj.__doc__ is None:
                     docstring = ''
                 else:
-                    docstring = str(obj.__doc__)
+                    docstring = obj.__doc__
+                    if not isinstance(docstring, basestring):
+                        docstring = str(docstring)
             except (TypeError, AttributeError):
                 docstring = ''
 



More information about the Python-checkins mailing list