mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-11 09:08:43 +08:00
Use AttributeError instead of hasattr
This commit is contained in:
+5
-4
@@ -75,10 +75,11 @@ class Completion(object):
|
|||||||
""" Return a document string for this completion object. """
|
""" Return a document string for this completion object. """
|
||||||
try:
|
try:
|
||||||
parent = self.name.parent()
|
parent = self.name.parent()
|
||||||
docstr = str(parent.docstr)
|
try:
|
||||||
if hasattr(parent, 'get_call_signature'):
|
return '%s\n\n%s' % (parent.get_call_signature(),
|
||||||
docstr = parent.get_call_signature() + '\n\n' + docstr
|
parent.docstr)
|
||||||
return docstr
|
except AttributeError:
|
||||||
|
return str(parent.docstr)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user