Skip to content

Commit

Permalink
Use ENDMARKER for python 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
wiktorn committed Jan 12, 2019
1 parent 38872dc commit 860de83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mypy/stubutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ def infer_sig_from_docstring(docstr: str, name: str) -> Optional[List[TypedFunct
accumulator = ""
state.append(State.RETURN_VALUE)

elif token.type == tokenize.NEWLINE and state[-1] in (State.INIT, State.RETURN_VALUE):
# ENDMAKER is necessary for python 3.4 and 3.5
elif token.type in (tokenize.NEWLINE, tokenize.ENDMARKER) and state[-1] in (
State.INIT, State.RETURN_VALUE):
if state[-1] == State.RETURN_VALUE:
ret_type = accumulator
accumulator = ""
Expand Down

0 comments on commit 860de83

Please sign in to comment.