Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2dfcef5

Browse files
committed
Fix check_unoptimized() function. The only optimized namespaces are
in function blocks. This elimiates spurious warnings about "import *" and related statements at the class level.
1 parent 8b528b2 commit 2dfcef5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/symtable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ check_unoptimized(const PySTEntryObject* ste) {
445445
char buf[300];
446446
const char* trailer;
447447

448-
if (ste->ste_type == ModuleBlock || !ste->ste_unoptimized
448+
if (ste->ste_type != FunctionBlock || !ste->ste_unoptimized
449449
|| !(ste->ste_free || ste->ste_child_free))
450450
return 1;
451451

0 commit comments

Comments
 (0)