summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-04-03 19:37:13 (GMT)
committerGitHub <noreply@github.com>2020-04-03 19:37:13 (GMT)
commit254ec783411d9d16e51f1116f98918be2ef0e884 (patch)
treee0520ead772c7d702bec0a4423ab538a4026e893 /Python/ast.c
parentbd6a4c3d72828d3d0e13922e165998539d24f8bc (diff)
downloadcpython-254ec783411d9d16e51f1116f98918be2ef0e884.zip
cpython-254ec783411d9d16e51f1116f98918be2ef0e884.tar.gz
cpython-254ec783411d9d16e51f1116f98918be2ef0e884.tar.bz2
bpo-40147: Move the check for duplicate keywords to the compiler (GH-19289)
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 550ee03..6ba62fb 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -3048,8 +3048,7 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func,
else {
/* a keyword argument */
keyword_ty kw;
- identifier key, tmp;
- int k;
+ identifier key;
// To remain LL(1), the grammar accepts any test (basically, any
// expression) in the keyword slot of a call site. So, we need
@@ -3093,14 +3092,6 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func,
if (forbidden_name(c, key, chch, 1)) {
return NULL;
}
- for (k = 0; k < nkeywords; k++) {
- tmp = ((keyword_ty)asdl_seq_GET(keywords, k))->arg;
- if (tmp && !PyUnicode_Compare(tmp, key)) {
- ast_error(c, chch,
- "keyword argument repeated");
- return NULL;
- }
- }
e = ast_for_expr(c, CHILD(ch, 2));
if (!e)
return NULL;