Skip to content

Commit 656e46b

Browse files
Apply suggestions from code review
Co-authored-by: Erlend E. Aasland <[email protected]>
1 parent a8425a6 commit 656e46b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Python/flowgraph.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,8 @@ _PyCfg_ConvertPseudoOps(basicblock *entryblock)
19891989
cfg_instr *instr = &b->b_instr[i];
19901990
if (is_block_push(instr) || instr->i_opcode == POP_BLOCK) {
19911991
INSTR_SET_OP0(instr, NOP);
1992-
} else if (instr->i_opcode == STORE_FAST_MAYBE_NULL) {
1992+
}
1993+
else if (instr->i_opcode == STORE_FAST_MAYBE_NULL) {
19931994
instr->i_opcode = STORE_FAST;
19941995
}
19951996
}

Python/symtable.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,8 @@ analyze_name(PySTEntryObject *ste, PyObject *scopes, PyObject *name, long flags,
560560
}
561561

562562
static int
563-
is_free_in_any_child(PySTEntryObject *entry, PyObject *key) {
563+
is_free_in_any_child(PySTEntryObject *entry, PyObject *key)
564+
{
564565
for (Py_ssize_t i = 0; i < PyList_GET_SIZE(entry->ste_children); i++) {
565566
PySTEntryObject *child_ste = (PySTEntryObject *)PyList_GET_ITEM(
566567
entry->ste_children, i);
@@ -604,7 +605,8 @@ inline_comprehension(PySTEntryObject *ste, PySTEntryObject *comp,
604605
return 0;
605606
}
606607
SET_SCOPE(scopes, k, scope);
607-
} else {
608+
}
609+
else {
608610
// free vars in comprehension that are locals in outer scope can
609611
// now simply be locals, unless they are free in comp children
610612
if ((PyLong_AsLong(existing) & DEF_BOUND) &&
@@ -902,7 +904,9 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
902904

903905
if (!analyze_child_block(entry, newbound, newfree, newglobal,
904906
&child_free))
907+
{
905908
goto error;
909+
}
906910
if (inline_comp) {
907911
if (!inline_comprehension(ste, entry, scopes, child_free)) {
908912
Py_DECREF(child_free);
@@ -927,8 +931,9 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
927931
assert(c && PySTEntry_Check(c));
928932
entry = (PySTEntryObject*)c;
929933
if (entry->ste_comp_inlined &&
930-
PyList_SetSlice(ste->ste_children, i, i + 1,
931-
entry->ste_children) < 0) {
934+
PyList_SetSlice(ste->ste_children, i, i + 1,
935+
entry->ste_children) < 0)
936+
{
932937
goto error;
933938
}
934939
}

0 commit comments

Comments
 (0)