Skip to content

Commit 67969f5

Browse files
authored
Correct micro release number and add a couple of asserts. (GH-25224)
1 parent 1be456a commit 67969f5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lib/importlib/_bootstrap_external.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def _write_atomic(path, data, mode=0o666):
348348
# Python 3.10a2 3433 (RERAISE restores f_lasti if oparg != 0)
349349
# Python 3.10a6 3434 (PEP 634: Structural Pattern Matching)
350350
# Python 3.10a7 3435 Use instruction offsets (as opposed to byte offsets).
351-
# Python 3.10a7 3436 (Add GEN_START bytecode #43683)
351+
# Python 3.10b1 3436 (Add GEN_START bytecode #43683)
352352

353353
#
354354
# MAGIC must change whenever the bytecode emitted by the compiler may no

Python/compile.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -6162,8 +6162,7 @@ stackdepth(struct compiler *c)
61626162
entryblock = b;
61636163
nblocks++;
61646164
}
6165-
if (!entryblock)
6166-
return 0;
6165+
assert(entryblock!= NULL);
61676166
stack = (basicblock **)PyObject_Malloc(sizeof(basicblock *) * nblocks);
61686167
if (!stack) {
61696168
PyErr_NoMemory();
@@ -6725,14 +6724,15 @@ assemble(struct compiler *c, int addNone)
67256724
nblocks++;
67266725
entryblock = b;
67276726
}
6727+
assert(entryblock != NULL);
67286728

67296729
if (insert_generator_prefix(c, entryblock)) {
67306730
goto error;
67316731
}
67326732

67336733
/* Set firstlineno if it wasn't explicitly set. */
67346734
if (!c->u->u_firstlineno) {
6735-
if (entryblock && entryblock->b_instr && entryblock->b_instr->i_lineno)
6735+
if (entryblock->b_instr && entryblock->b_instr->i_lineno)
67366736
c->u->u_firstlineno = entryblock->b_instr->i_lineno;
67376737
else
67386738
c->u->u_firstlineno = 1;

0 commit comments

Comments
 (0)