diff options
author | Jim Fulton <jim@zope.com> | 2004-10-13 14:15:32 (GMT) |
---|---|---|
committer | Jim Fulton <jim@zope.com> | 2004-10-13 14:15:32 (GMT) |
commit | 7d428788e156200df2f8e6421cad9fce083fd96b (patch) | |
tree | 64ee331217a5b783b97b63b020c2a31636e72fe2 /Lib/doctest.py | |
parent | 73cc8479f000bbb84d0775aea55fb9de75ec110e (diff) | |
download | cpython-7d428788e156200df2f8e6421cad9fce083fd96b.zip cpython-7d428788e156200df2f8e6421cad9fce083fd96b.tar.gz cpython-7d428788e156200df2f8e6421cad9fce083fd96b.tar.bz2 |
Fixed a small bug. doctest didn't handle unicode docstrings containing
non-ascii characters.
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r-- | Lib/doctest.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index 26a8914..a8162f3 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -962,7 +962,9 @@ class DocTestFinder: 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 = '' |