From 7cd25434164882c2093ea41ccfc7b95a05cd5cbd Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Fri, 26 Oct 2018 12:19:14 +0100 Subject: bpo-34890: Make iscoroutinefunction, isgeneratorfunction and isasyncgenfunction work with functools.partial (GH-9903) inspect.isfunction() processes both inspect.isfunction(func) and inspect.isfunction(partial(func, arg)) correctly but some other functions in the inspect module (iscoroutinefunction, isgeneratorfunction and isasyncgenfunction) lack this functionality. This commits adds a new check in the mentioned functions in the inspect module so they can work correctly with arbitrarily nested partial functions. --- Lib/test/test_asyncio/test_tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/test/test_asyncio/test_tasks.py') diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 0fe767630f..c65d1f2440 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -440,8 +440,8 @@ class BaseTaskTests: coro_repr = repr(task._coro) expected = ( - r'\.func\(1\)\(\) running, ' + r'\.func at' ) self.assertRegex(coro_repr, expected) -- cgit v1.2.1