Fixed a small bug. doctest didn't handle unicode docstrings containing

non-ascii characters.
This commit is contained in:
Jim Fulton 2004-10-13 14:15:32 +00:00
parent 73cc8479f0
commit 7d428788e1
3 changed files with 26 additions and 3 deletions

View file

@ -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 = ''