Fix automethod outside class context.

This commit is contained in:
Georg Brandl 2008-12-09 23:37:39 +01:00
parent 058001c831
commit 0d88e4b020
2 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,8 @@
Release 0.5.1 (in development) Release 0.5.1 (in development)
============================== ==============================
* Fix autodoc crash when automethod is used outside a class context.
* Fix LaTeX writer output for images with specified height. * Fix LaTeX writer output for images with specified height.
* Fix wrong generated image path when including images in sources * Fix wrong generated image path when including images in sources

View File

@ -321,6 +321,9 @@ class RstGenerator(object):
# ... or from a class directive # ... or from a class directive
if mod_cls is None: if mod_cls is None:
mod_cls = self.env.currclass mod_cls = self.env.currclass
# ... if still None, there's no way to know
if mod_cls is None:
return fullname, None, [], args, retann
mod, cls = rpartition(mod_cls, '.') mod, cls = rpartition(mod_cls, '.')
# if the module name is still missing, get it like above # if the module name is still missing, get it like above
if not mod and hasattr(self.env, 'autodoc_current_module'): if not mod and hasattr(self.env, 'autodoc_current_module'):