mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391)
This commit is contained in:
parent
38aefc585f
commit
799d7d61a9
3 changed files with 8 additions and 2 deletions
|
@ -99,6 +99,7 @@ class SymtableTest(unittest.TestCase):
|
|||
self.assertTrue(self.spam.lookup("bar").is_declared_global())
|
||||
self.assertFalse(self.internal.lookup("x").is_global())
|
||||
self.assertFalse(self.Mine.lookup("instance_var").is_global())
|
||||
self.assertTrue(self.spam.lookup("bar").is_global())
|
||||
|
||||
def test_nonlocal(self):
|
||||
self.assertFalse(self.spam.lookup("some_var").is_nonlocal())
|
||||
|
@ -108,7 +109,10 @@ class SymtableTest(unittest.TestCase):
|
|||
|
||||
def test_local(self):
|
||||
self.assertTrue(self.spam.lookup("x").is_local())
|
||||
self.assertFalse(self.internal.lookup("x").is_local())
|
||||
self.assertFalse(self.spam.lookup("bar").is_local())
|
||||
|
||||
def test_free(self):
|
||||
self.assertTrue(self.internal.lookup("x").is_free())
|
||||
|
||||
def test_referenced(self):
|
||||
self.assertTrue(self.internal.lookup("x").is_referenced())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue