1
0
forked from VimPlug/jedi

Use AttributeError instead of hasattr

This commit is contained in:
Takafumi Arakaki
2012-11-04 11:26:06 +01:00
parent 5c76b20434
commit 5a20cd1665

View File

@@ -75,10 +75,11 @@ class Completion(object):
""" Return a document string for this completion object. """
try:
parent = self.name.parent()
docstr = str(parent.docstr)
if hasattr(parent, 'get_call_signature'):
docstr = parent.get_call_signature() + '\n\n' + docstr
return docstr
try:
return '%s\n\n%s' % (parent.get_call_signature(),
parent.docstr)
except AttributeError:
return str(parent.docstr)
except AttributeError:
return ''