mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix inspect.getattr_static to work on modules (again).
Closes issue 11813.
This commit is contained in:
parent
bd206e27a4
commit
a51623b160
3 changed files with 14 additions and 4 deletions
|
@ -1004,6 +1004,11 @@ class TestGetattrStatic(unittest.TestCase):
|
|||
self.assertEqual(inspect.getattr_static(instance, "spam"), 42)
|
||||
self.assertFalse(Thing.executed)
|
||||
|
||||
def test_module(self):
|
||||
sentinel = object()
|
||||
self.assertIsNot(inspect.getattr_static(sys, "version", sentinel),
|
||||
sentinel)
|
||||
|
||||
class TestGetGeneratorState(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue