mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Fix an issue with None docstrings
This commit is contained in:
@@ -728,15 +728,15 @@ class _Help(object):
|
||||
|
||||
doc = context.py__doc__()
|
||||
|
||||
if raw:
|
||||
signature_text = ''
|
||||
else:
|
||||
signature_text = _format_signatures(context)
|
||||
if not doc and context.is_stub():
|
||||
for c in stub_to_actual_context_set(context):
|
||||
doc = c.py__doc__()
|
||||
if doc:
|
||||
break
|
||||
signature_text = ''
|
||||
if self._name.is_context_name:
|
||||
if not raw:
|
||||
signature_text = _format_signatures(context)
|
||||
if not doc and context.is_stub():
|
||||
for c in stub_to_actual_context_set(context):
|
||||
doc = c.py__doc__()
|
||||
if doc:
|
||||
break
|
||||
|
||||
if signature_text and 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 'typeshed' in def_.module_path
|
||||
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