diff options
author | Karthikeyan Singaravelan <tir.karthi@gmail.com> | 2021-04-12 18:17:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-12 18:17:25 (GMT) |
commit | a9cf69df2e031d6157f01289f66ca9cf723ceb5c (patch) | |
tree | 10b37ae2e40dceb13f0725ac6d52d49ac3dc08ff /Lib/test | |
parent | 852150ddfe68bc2696fc880175aeb855a0c16ae6 (diff) | |
download | cpython-a9cf69df2e031d6157f01289f66ca9cf723ceb5c.zip cpython-a9cf69df2e031d6157f01289f66ca9cf723ceb5c.tar.gz cpython-a9cf69df2e031d6157f01289f66ca9cf723ceb5c.tar.bz2 |
bpo-41515: Fix KeyError raised in get_type_hints (GH-25352)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: efahl <36704995+efahl@users.noreply.github.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_typing.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 062163c..a6afd35 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -2267,6 +2267,12 @@ class ClassVarTests(BaseTestCase): with self.assertRaises(TypeError): issubclass(int, ClassVar) + def test_bad_module(self): + # bpo-41515 + class BadModule: + pass + BadModule.__module__ = 'bad' # Something not in sys.modules + assert(get_type_hints(BadModule), {}) class FinalTests(BaseTestCase): |