diff options
author | Michael Foord <michael@voidspace.org.uk> | 2011-12-18 22:01:40 (GMT) |
---|---|---|
committer | Michael Foord <michael@voidspace.org.uk> | 2011-12-18 22:01:40 (GMT) |
commit | a51623b1602d6bb695fee36e74146269e6358d6b (patch) | |
tree | cf8c1e5c5c2a0190ca377bd81841a21aac0c9d34 /Lib/test/test_inspect.py | |
parent | bd206e27a49dd4cc94ee264c706614190ce0eb3c (diff) | |
download | cpython-a51623b1602d6bb695fee36e74146269e6358d6b.zip cpython-a51623b1602d6bb695fee36e74146269e6358d6b.tar.gz cpython-a51623b1602d6bb695fee36e74146269e6358d6b.tar.bz2 |
Fix inspect.getattr_static to work on modules (again).
Closes issue 11813.
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r-- | Lib/test/test_inspect.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 7666fe4..abbdc9f 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -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): |