bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391) (GH-19394)

(cherry picked from commit 799d7d61a91eb0ad3256ef9a45a90029cef93b7c)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
diff --git a/Lib/symtable.py b/Lib/symtable.py
index 5bea7cf..ac0a64f 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -197,7 +197,7 @@
         return bool(self.__scope == GLOBAL_EXPLICIT)
 
     def is_local(self):
-        return bool(self.__flags & DEF_BOUND)
+        return bool(self.__scope in (LOCAL, CELL))
 
     def is_annotated(self):
         return bool(self.__flags & DEF_ANNOT)