bpo-33261: guard access to __code__ attribute in inspect (GH-6448)

This commit is contained in:
Jeroen Demeyer 2019-04-02 16:03:42 +02:00 committed by Petr Viktorin
parent 487b73ab39
commit fcef60f59d
4 changed files with 29 additions and 9 deletions

View file

@ -146,6 +146,7 @@ class TestPredicates(IsTestBase):
self.istest(inspect.isfunction, 'mod.spam')
self.istest(inspect.isfunction, 'mod.StupidGit.abuse')
self.istest(inspect.ismethod, 'git.argue')
self.istest(inspect.ismethod, 'mod.custom_method')
self.istest(inspect.ismodule, 'mod')
self.istest(inspect.isdatadescriptor, 'collections.defaultdict.default_factory')
self.istest(inspect.isgenerator, '(x for x in range(2))')