8000 compiler_pattern_or returns SUCCESS/ERROR · python/cpython@31bc6cd · GitHub
[go: up one dir, main page]

Skip to content

Commit 31bc6cd

Browse files
committed
compiler_pattern_or returns SUCCESS/ERROR
1 parent 2e23b8f commit 31bc6cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Python/compile.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7097,15 +7097,15 @@ compiler_pattern_or(struct compiler *c, pattern_ty p, pattern_context *pc)
70977097
Py_DECREF(control);
70987098
// NOTE: Returning macros are safe again.
70997099
// Pop the copy of the subject:
7100-
_ADDOP(c, LOC(p), POP_TOP);
7101-
return 1;
7100+
ADDOP(c, LOC(p), POP_TOP);
7101+
return SUCCESS;
71027102
diff:
71037103
compiler_error(c, LOC(p), "alternative patterns bind different names");
71047104
error:
71057105
PyObject_Free(old_pc.fail_pop);
71067106
Py_DECREF(old_pc.stores);
71077107
Py_XDECREF(control);
7108-
return 0;
7108+
return ERROR;
71097109
}
71107110

71117111

@@ -7225,7 +7225,7 @@ compiler_pattern(struct compiler *c, pattern_ty p, pattern_context *pc)
72257225
case MatchAs_kind:
72267226
return compiler_pattern_as(c, p, pc) == SUCCESS ? 1 : 0;
72277227
case MatchOr_kind:
7228-
return compiler_pattern_or(c, p, pc);
7228+
return compiler_pattern_or(c, p, pc) == SUCCESS ? 1 : 0;
72297229
}
72307230
// AST validator shouldn't let this happen, but if it does,
72317231
// just fail, don't crash out of the interpreter

0 commit comments

Comments
 (0)
0