summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c5
-rw-r--r--Python/graminit.c13
2 files changed, 10 insertions, 8 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 16bf291..5781b21 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4624,7 +4624,7 @@ com_classdef(struct compiling *c, node *n)
char *name;
REQ(n, classdef);
- /* classdef: class NAME ['(' testlist ')'] ':' suite */
+ /* classdef: class NAME ['(' [testlist] ')'] ':' suite */
if ((v = PyString_InternFromString(STR(CHILD(n, 1)))) == NULL) {
c->c_errors++;
return;
@@ -4635,7 +4635,8 @@ com_classdef(struct compiling *c, node *n)
com_push(c, 1);
Py_DECREF(v);
/* Push the tuple of base classes on the stack */
- if (TYPE(CHILD(n, 2)) != LPAR) {
+ if (TYPE(CHILD(n, 2)) != LPAR ||
+ TYPE(CHILD(n, 3)) == RPAR) {
com_addoparg(c, BUILD_TUPLE, 0);
com_push(c, 1);
}
diff --git a/Python/graminit.c b/Python/graminit.c
index c4fe661..464f0ae 100644
--- a/Python/graminit.c
+++ b/Python/graminit.c
@@ -1426,26 +1426,27 @@ static arc arcs_67_2[2] = {
{13, 3},
{21, 4},
};
-static arc arcs_67_3[1] = {
+static arc arcs_67_3[2] = {
{9, 5},
+ {15, 6},
};
static arc arcs_67_4[1] = {
- {22, 6},
+ {22, 7},
};
static arc arcs_67_5[1] = {
- {15, 7},
+ {15, 6},
};
static arc arcs_67_6[1] = {
- {0, 6},
+ {21, 4},
};
static arc arcs_67_7[1] = {
- {21, 4},
+ {0, 7},
};
static state states_67[8] = {
{1, arcs_67_0},
{1, arcs_67_1},
{2, arcs_67_2},
- {1, arcs_67_3},
+ {2, arcs_67_3},
{1, arcs_67_4},
{1, arcs_67_5},
{1, arcs_67_6},