repoze/repoze.sphinx.autointerface — Issue #1: Crash when applying autointerface to a non-class object.
Author: pjdelport
Created: 2012-01-27 21:19:18+00:00
State: open

(repoze.sphinx.autointerface: 0.6.2)

I gave it a module name, and this happened:

```pytb
# Sphinx version: 1.1.2
# Python version: 2.7.2+
# Docutils version: 0.8.1 release
# Jinja2 version: 2.6
Traceback (most recent call last):
File "<...>/lib/python2.7/site-packages/sphinx/cmdline.py", line 189, in main
app.build(force_all, filenames)

[...lots of callers...]

File "<...>/lib/python2.7/site-packages/docutils/parsers/rst/states.py", line 2087, in run_directive
result = directive_instance.run()
File "<...>/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 1299, in run
documenter.generate(more_content=self.content)
File "<...>/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 720, in generate
self.add_directive_header(sig)
File "<...>/lib/python2.7/site-packages/repoze/sphinx/autointerface.py", line 40, in add_directive_header
bases=[base for base in self.object.__bases__ if base is not Interface]
AttributeError: 'module' object has no attribute '__bases__'
```

There should probably be a `isinstance(self.object, (type, types.ClassType))` check in there somewhere, with a friendlier error message.