diff -r 361d7af9396e Lib/inspect.py --- a/Lib/inspect.py Sat Jul 18 23:27:00 2015 +0300 +++ b/Lib/inspect.py Sun Jul 19 08:52:27 2015 -0400 @@ -798,7 +798,7 @@ if not hasattr(object, 'co_firstlineno'): raise OSError('could not find function definition') lnum = object.co_firstlineno - 1 - pat = re.compile(r'^(\s*def\s)|(.*(? 0: if pat.match(lines[lnum]): break lnum = lnum - 1 diff -r 361d7af9396e Lib/test/inspect_fodder.py --- a/Lib/test/inspect_fodder.py Sat Jul 18 23:27:00 2015 +0300 +++ b/Lib/test/inspect_fodder.py Sun Jul 19 08:52:27 2015 -0400 @@ -66,3 +66,6 @@ pass def contradiction(self): pass + +async def lobbest(grenade): + pass diff -r 361d7af9396e Lib/test/test_inspect.py --- a/Lib/test/test_inspect.py Sat Jul 18 23:27:00 2015 +0300 +++ b/Lib/test/test_inspect.py Sun Jul 19 08:52:27 2015 -0400 @@ -336,6 +336,7 @@ def test_getfunctions(self): functions = inspect.getmembers(mod, inspect.isfunction) self.assertEqual(functions, [('eggs', mod.eggs), + ('lobbest', mod.lobbest), ('spam', mod.spam)]) @unittest.skipIf(sys.flags.optimize >= 2, @@ -393,6 +394,7 @@ def test_getsource(self): self.assertSourceEqual(git.abuse, 29, 39) self.assertSourceEqual(mod.StupidGit, 21, 50) + self.assertSourceEqual(mod.lobbest, 70, 71) def test_getsourcefile(self): self.assertEqual(normcase(inspect.getsourcefile(mod.spam)), modfile)