changeset: 105003:8e3d359cc73b parent: 105000:6f51b495656c parent: 105002:6540adb8722a user: Yury Selivanov date: Tue Nov 08 19:59:57 2016 -0500 files: Misc/NEWS description: Merge 3.6 (issue #28639) diff -r 6f51b495656c -r 8e3d359cc73b Lib/inspect.py --- a/Lib/inspect.py Tue Nov 08 19:46:41 2016 -0500 +++ b/Lib/inspect.py Tue Nov 08 19:59:57 2016 -0500 @@ -219,10 +219,10 @@ return isinstance(object, types.CoroutineType) def isawaitable(object): - """Return true is object can be passed to an ``await`` expression.""" + """Return true if object can be passed to an ``await`` expression.""" return (isinstance(object, types.CoroutineType) or isinstance(object, types.GeneratorType) and - object.gi_code.co_flags & CO_ITERABLE_COROUTINE or + bool(object.gi_code.co_flags & CO_ITERABLE_COROUTINE) or isinstance(object, collections.abc.Awaitable)) def istraceback(object):