mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Fix an issue with None docstrings
This commit is contained in:
@@ -728,15 +728,15 @@ class _Help(object):
|
|||||||
|
|
||||||
doc = context.py__doc__()
|
doc = context.py__doc__()
|
||||||
|
|
||||||
if raw:
|
signature_text = ''
|
||||||
signature_text = ''
|
if self._name.is_context_name:
|
||||||
else:
|
if not raw:
|
||||||
signature_text = _format_signatures(context)
|
signature_text = _format_signatures(context)
|
||||||
if not doc and context.is_stub():
|
if not doc and context.is_stub():
|
||||||
for c in stub_to_actual_context_set(context):
|
for c in stub_to_actual_context_set(context):
|
||||||
doc = c.py__doc__()
|
doc = c.py__doc__()
|
||||||
if doc:
|
if doc:
|
||||||
break
|
break
|
||||||
|
|
||||||
if signature_text and doc:
|
if signature_text and doc:
|
||||||
full_doc += signature_text + '\n\n' + doc
|
full_doc += signature_text + '\n\n' + doc
|
||||||
|
|||||||
@@ -46,3 +46,9 @@ def test_keyword_attributes(Script):
|
|||||||
assert def_.module_name in ('builtins', '__builtin__')
|
assert def_.module_name in ('builtins', '__builtin__')
|
||||||
assert 'typeshed' in def_.module_path
|
assert 'typeshed' in def_.module_path
|
||||||
assert def_.type == 'keyword'
|
assert def_.type == 'keyword'
|
||||||
|
|
||||||
|
|
||||||
|
def test_none_keyword(Script):
|
||||||
|
none, = Script('None').completions()
|
||||||
|
assert not none.docstring()
|
||||||
|
assert none.name == 'None'
|
||||||
|
|||||||
Reference in New Issue
Block a user