Skip to content

bpo-43683: Minor corrections. #25224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/importlib/_bootstrap_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def _write_atomic(path, data, mode=0o666):
# Python 3.10a2 3433 (RERAISE restores f_lasti if oparg != 0)
# Python 3.10a6 3434 (PEP 634: Structural Pattern Matching)
# Python 3.10a7 3435 Use instruction offsets (as opposed to byte offsets).
# Python 3.10a7 3436 (Add GEN_START bytecode #43683)
# Python 3.10b1 3436 (Add GEN_START bytecode #43683)

#
# MAGIC must change whenever the bytecode emitted by the compiler may no
Expand Down
6 changes: 3 additions & 3 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -6162,8 +6162,7 @@ stackdepth(struct compiler *c)
entryblock = b;
nblocks++;
}
if (!entryblock)
return 0;
assert(entryblock!= NULL);
stack = (basicblock **)PyObject_Malloc(sizeof(basicblock *) * nblocks);
if (!stack) {
PyErr_NoMemory();
Expand Down Expand Up @@ -6725,14 +6724,15 @@ assemble(struct compiler *c, int addNone)
nblocks++;
entryblock = b;
}
assert(entryblock != NULL);

if (insert_generator_prefix(c, entryblock)) {
goto error;
}

/* Set firstlineno if it wasn't explicitly set. */
if (!c->u->u_firstlineno) {
if (entryblock && entryblock->b_instr && entryblock->b_instr->i_lineno)
if (entryblock->b_instr && entryblock->b_instr->i_lineno)
c->u->u_firstlineno = entryblock->b_instr->i_lineno;
else
c->u->u_firstlineno = 1;
Expand Down