davidhalter/jedi — pull request #359 by DamnWidget (2013-12-20 14:11:05+00:00)
Title: Fix for PyQt4 import due unbound function references

This fix the issue https://github.com/DamnWidget/anaconda/issues/108 of the Anaconda ST3 plugin initially reported by @augusto2112

Is a simple fix that just adds AttributeError to the list of exceptions that are already catch by `_parse_function_doc` of `builtin` module when trying to get full string from a function docstring.

The problem was it fails when try to parse an unbound function (like PyQt4.QtCore.pyqtSignal) as it doesn't have the attribute `__name__` as it is not an instance.

There is another possible workaround just wrapping the call to `debug.dbg(func, func.__name__, doc)` in another try...except block and using `debug.dbg(func, func.__class__.__name__, doc)` in case of an `AttributeError` exception but it doesn't feel right.

I am not familiar at all with Jedi internals so feel free to just reject this pull request if the workaround is ridiculous.

Regards.