8000 [stubgenc] fixes and typos by sizmailov · Pull Request #9877 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

[stubgenc] fixes and typos #9877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[stubgenc] Fix parsing signatures with empty argument list
  • Loading branch information
sizmailov committed Jan 12, 2021
commit eeb3f6864fc563cb395b0ced12915971d2fa7489
3 changes: 2 additions & 1 deletion mypy/stubdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def add_token(self, token: tokenize.TokenInfo) -> None:
self.state.pop()
elif self.state[-1] == STATE_ARGUMENT_LIST:
self.arg_name = self.accumulator
if not _ARG_NAME_RE.match(self.arg_name):
if not (token.string == ')' and self.accumulator.strip() == '') \
and not _ARG_NAME_RE.match(self.arg_name):
# Invalid argument name.
self.reset()
return
Expand Down
0