Skip to content

Commit 860de83

Browse files
committed
Use ENDMARKER for python 3.4
1 parent 38872dc commit 860de83

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypy/stubutil.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ def infer_sig_from_docstring(docstr: str, name: str) -> Optional[List[TypedFunct
210210
accumulator = ""
211211
state.append(State.RETURN_VALUE)
212212

213-
elif token.type == tokenize.NEWLINE and state[-1] in (State.INIT, State.RETURN_VALUE):
213+
# ENDMAKER is necessary for python 3.4 and 3.5
214+
elif token.type in (tokenize.NEWLINE, tokenize.ENDMARKER) and state[-1] in (
215+
State.INIT, State.RETURN_VALUE):
214216
if state[-1] == State.RETURN_VALUE:
215217
ret_type = accumulator
216218
accumulator = ""

0 commit comments

Comments
 (0)