mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 15:24:46 +08:00
fixed a problem with docstrings that were empty (None), docstrings in Jedi are always strings.
This commit is contained in:
@@ -26,7 +26,7 @@ class CompiledObject(Base):
|
||||
def __init__(self, obj, parent=None):
|
||||
self.obj = obj
|
||||
self.parent = parent
|
||||
self.doc = inspect.getdoc(obj)
|
||||
self.doc = inspect.getdoc(obj) or ''
|
||||
|
||||
@property
|
||||
def params(self):
|
||||
|
||||
@@ -38,3 +38,12 @@ def test_parse_function_doc_illegal_docstr():
|
||||
doesn't have a closing bracket.
|
||||
"""
|
||||
assert ('', '') == compiled._parse_function_doc(docstr)
|
||||
|
||||
|
||||
def test_doc():
|
||||
"""
|
||||
Even CompiledObject docs always return empty docstrings - not None, that's
|
||||
just a Jedi API definition.
|
||||
"""
|
||||
obj = compiled.CompiledObject(''.__getnewargs__)
|
||||
assert obj.doc == ''
|
||||
|
||||
Reference in New Issue
Block a user