Skip to content

Instantly share code, notes, and snippets.

@rctay
Created March 27, 2010 04:47
Show Gist options
  • Save rctay/345738 to your computer and use it in GitHub Desktop.
Save rctay/345738 to your computer and use it in GitHub Desktop.
[sphinx] autodoc support for module-level properties
diff -r f76fb0be8011 sphinx/ext/autodoc.py
--- a/sphinx/ext/autodoc.py Mon Mar 01 23:12:59 2010 +0100
+++ b/sphinx/ext/autodoc.py Sat Mar 27 12:46:20 2010 +0800
@@ -336,7 +336,7 @@
Get the real module name of an object to document. (It can differ
from the name of the module through which the object was imported.)
"""
- return self.get_attr(self.object, '__module__', None) or self.modname
+ return self.modname or self.get_attr(self.object, '__module__', None)
def check_module(self):
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment