8000 compiler_assert returns SUCCESS/ERROR · python/cpython@73d8b72 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /react-partial>

Commit 73d8b72

Browse files
committed
compiler_assert returns SUCCESS/ERROR
1 parent 6136f33 commit 73d8b72

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Python/compile.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4149,25 +4149,25 @@ compiler_assert(struct compiler *c, stmt_ty s)
41494149
if (!compiler_warn(c, LOC(s), "assertion is always true, "
41504150
"perhaps remove parentheses?"))
41514151
{
4152-
return 0;
4152+
return ERROR;
41534153
}
41544154
}
41554155
if (c->c_optimize) {
4156-
return 1;
4156+
return SUCCESS;
41574157
}
41584158
NEW_JUMP_TARGET_LABEL(c, end);
41594159
if (!compiler_jump_if(c, LOC(s), s->v.Assert.test, end, 1)) {
4160-
return 0;
4160+
return ERROR;
41614161
}
4162-
_ADDOP(c, LOC(s), LOAD_ASSERTION_ERROR);
4162+
ADDOP(c, LOC(s), LOAD_ASSERTION_ERROR);
41634163
if (s->v.Assert.msg) {
4164-
_VISIT(c, expr, s->v.Assert.msg);
4165-
_ADDOP_I(c, LOC(s), CALL, 0);
4164+
VISIT(c, expr, s->v.Assert.msg);
4165+
ADDOP_I(c, LOC(s), CALL, 0);
41664166
}
4167-
_ADDOP_I(c, LOC(s), RAISE_VARARGS, 1);
4167+
ADDOP_I(c, LOC(s), RAISE_VARARGS, 1);
41684168

41694169
USE_LABEL(c, end);
4170-
return 1;
4170+
return SUCCESS;
41714171
}
41724172

41734173
static int
@@ -4248,7 +4248,7 @@ compiler_visit_stmt(struct compiler *c, stmt_ty s)
42484248
case TryStar_kind:
42494249
return compiler_try_star(c, s) == SUCCESS ? 1 : 0;
42504250
case Assert_kind:
4251-
return compiler_assert(c, s);
4251+
return compiler_assert(c, s) == SUCCESS ? 1 : 0;
42524252
case Import_kind:
42534253
return compiler_import(c, s);
42544254
case ImportFrom_kind:

0 commit comments

Comments
 (0)
0