summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/ast.c6
-rw-r--r--Python/bltinmodule.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 2f1ae60b6c..b48471e502 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -115,7 +115,7 @@ validate_arguments(arguments_ty args)
}
if (!validate_args(args->kwonlyargs))
return 0;
- if (args->kwarg && args->kwarg->annotation
+ if (args->kwarg && args->kwarg->annotation
&& !validate_expr(args->kwarg->annotation, Load)) {
return 0;
}
@@ -164,6 +164,8 @@ validate_expr(expr_ty exp, expr_context_ty ctx)
return 0;
}
check_ctx = 0;
+ /* set actual_ctx to prevent gcc warning */
+ actual_ctx = 0;
}
if (check_ctx && actual_ctx != ctx) {
PyErr_Format(PyExc_ValueError, "expression must have %s context but has %s instead",
@@ -451,7 +453,7 @@ validate_exprs(asdl_seq *exprs, expr_context_ty ctx, int null_ok)
"None disallowed in expression list");
return 0;
}
-
+
}
return 1;
}
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index f9bb388b5a..4f61d1e710 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -53,7 +53,7 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
PyObject *func, *name, *bases, *mkw, *meta, *winner, *prep, *ns, *cell;
PyObject *cls = NULL;
Py_ssize_t nargs;
- int isclass;
+ int isclass = 0; /* initialize to prevent gcc warning */
assert(args != NULL);
if (!PyTuple_Check(args)) {