Commits

Tay Ray Chuan committed 90e9599

autodoc: give precedence to user-specified module

The autodoc test (".. autodata:: ClassInstance") now shows "Class
instance to document".

Comments (0)

Files changed (1)

sphinx/ext/autodoc.py

         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):
         """