#3041: fix handling of unicode docstrings.

This commit is contained in:
Georg Brandl 2008-06-05 17:06:34 +00:00
parent f4d5c0a380
commit 063d4d88f7
2 changed files with 3 additions and 1 deletions

View File

@ -69,6 +69,8 @@ Bugs fixed
* Fix the handling of explicit module names given to autoclass directives. * Fix the handling of explicit module names given to autoclass directives.
They now show up with the correct module name in the generated docs. They now show up with the correct module name in the generated docs.
* Enable autodoc to process Unicode docstrings.
Release 0.3 (May 6, 2008) Release 0.3 (May 6, 2008)
========================= =========================

View File

@ -218,7 +218,7 @@ def generate_rst(what, name, members, inherited, undoc, add_content, document,
module = getattr(todoc, '__module__', None) module = getattr(todoc, '__module__', None)
if module is not None: if module is not None:
charset = get_module_charset(module) charset = get_module_charset(module)
docstrings = [docstring.decode(charset) for docstring in docstrings] docstrings = [isinstance(d, str) and d.decode(charset) or d for d in docstrings]
# add docstring content # add docstring content
for docstring in docstrings: for docstring in docstrings: