From d0127a7f61bfab3436cbe9dbbc1384b843b0b06a Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 25 May 2017 12:26:07 -0400 Subject: [PATCH] Fix a warning that happened if there was no valid Python function in a place. --- jedi/evaluate/docstrings.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jedi/evaluate/docstrings.py b/jedi/evaluate/docstrings.py index 0a7854e4..d00c422c 100644 --- a/jedi/evaluate/docstrings.py +++ b/jedi/evaluate/docstrings.py @@ -117,7 +117,11 @@ def _strip_rst_role(type_str): def _evaluate_for_statement_string(module_context, string): code = dedent(u(""" def pseudo_docstring_stuff(): - # Create a pseudo function for docstring statements. + ''' + Create a pseudo function for docstring statements. + Need this docstring so that if the below part is not valid Python this + is still a function. + ''' {0} """)) if string is None: