Merge pull request #18 from LazyImportsCabal/bad_global

Fix eager imports in try/except in global mode
This commit is contained in:
Dino Viehland 2025-10-25 15:33:55 -07:00 committed by GitHub
commit c075f5b4fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -790,7 +790,7 @@ _PyCompile_TopFBlock(compiler *c)
bool
_PyCompile_InExceptionHandler(compiler *c)
{
for (Py_ssize_t i = c->u->u_nfblocks; i < c->u->u_nfblocks; i++) {
for (Py_ssize_t i = 0; i < c->u->u_nfblocks; i++) {
fblockinfo *block = &c->u->u_fblock[i];
switch (block->fb_type) {
case COMPILE_FBLOCK_TRY_EXCEPT: