Skip to content

Commit 155959b

Browse files
author
Guido van Rossum
authored
Don't crash on double-underscore-prefixed keyword arg (#6736)
This avoids the crash reported in #6727. However that issue should remain open, because there's a logic bug somewhere (but it's not high enough priority to try and track it down).
1 parent 2baebda commit 155959b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mypy/checkexpr.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,8 +1138,7 @@ def check_argument_count(self,
11381138
not is_unexpected_arg_error):
11391139
# No actual for a mandatory named formal
11401140
if messages:
1141-
argname = callee.arg_names[i]
1142-
assert argname is not None
1141+
argname = callee.arg_names[i] or "?"
11431142
messages.missing_named_argument(callee, context, argname)
11441143
ok = False
11451144
elif kind in [nodes.ARG_POS, nodes.ARG_OPT,

0 commit comments

Comments
 (0)