Skip to content

Commit ed79a88

Browse files
committed
tweaks
1 parent 0109e75 commit ed79a88

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Python/compile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ _PyCompile_EnterConditionalBlock(struct _PyCompiler *c)
11191119
void
11201120
_PyCompile_LeaveConditionalBlock(struct _PyCompiler *c)
11211121
{
1122+
assert(c->u->u_in_conditional_block > 0);
11221123
c->u->u_in_conditional_block--;
11231124
}
11241125

@@ -1166,6 +1167,7 @@ _PyCompile_AddDeferredAnnotation(compiler *c, stmt_ty s,
11661167
Py_DECREF(index);
11671168
return ERROR;
11681169
}
1170+
Py_DECREF(index);
11691171
return SUCCESS;
11701172
}
11711173

Python/symtable.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2730,7 +2730,8 @@ symtable_visit_annotation(struct symtable *st, expr_ty annotation, void *key)
27302730
{
27312731
if ((st->st_cur->ste_type == ClassBlock || st->st_cur->ste_type == ModuleBlock)
27322732
&& st->st_cur->ste_in_conditional_block
2733-
&& !st->st_cur->ste_has_conditional_annotations) {
2733+
&& !st->st_cur->ste_has_conditional_annotations)
2734+
{
27342735
st->st_cur->ste_has_conditional_annotations = 1;
27352736
if (!symtable_add_def(st, &_Py_ID(__conditional_annotations__), USE, LOCATION(annotation))) {
27362737
return 0;

0 commit comments

Comments
 (0)