1
0
forked from VimPlug/jedi

Unconditionally set attribute docstrings

As Statement.assignment_details triggers parsing inside
statement let's don't check assignment_details when setting
attribute docstrings.
This commit is contained in:
Takafumi Arakaki
2013-02-24 19:45:47 +01:00
parent 540eff3d42
commit e458b35f1c

View File

@@ -403,11 +403,8 @@ class Parser(object):
not stmt.used_vars and
len(stmt.token_list) == 1 and
first_tok[0] == tokenize.STRING):
# ... and the last statement was assignment
last_stmt = self.scope.statements[-1]
if last_stmt.assignment_details[0][1] == '=':
# ... then set it as a docstring
last_stmt.add_docstr(first_tok[1])
# ... then set it as a docstring
self.scope.statements[-1].add_docstr(first_tok[1])
except (IndexError, AttributeError):
pass