From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 22675138350 for ; Sat, 29 Feb 2020 04:33:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2E05EE0895; Sat, 29 Feb 2020 04:33:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A1289E0895 for ; Sat, 29 Feb 2020 04:33:16 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 49F8634F3CF for ; Sat, 29 Feb 2020 04:33:15 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AC193177 for ; Sat, 29 Feb 2020 04:33:12 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1582950710.64b11fe4dbcd7f2b4c36d8c40a09425a2c624c7a.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/util/futures/_asyncio/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/util/futures/_asyncio/__init__.py X-VCS-Directories: lib/portage/util/futures/_asyncio/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 64b11fe4dbcd7f2b4c36d8c40a09425a2c624c7a X-VCS-Branch: master Date: Sat, 29 Feb 2020 04:33:12 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 84d72c15-d157-4144-b06b-2966aeeac99d X-Archives-Hash: 556da55994d008a0237ace87e95aab9c commit: 64b11fe4dbcd7f2b4c36d8c40a09425a2c624c7a Author: Zac Medico gentoo org> AuthorDate: Sat Feb 29 04:24:19 2020 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Feb 29 04:31:50 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=64b11fe4 asyncio: improve _AsyncioEventLoop isinstance logic Since _AsyncioEventLoop can be wrapped, use the _asyncio_wrapper attributre for isinstance checks (_wrap_loop guarantees that this attribute exists). Signed-off-by: Zac Medico gentoo.org> lib/portage/util/futures/_asyncio/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/portage/util/futures/_asyncio/__init__.py b/lib/portage/util/futures/_asyncio/__init__.py index 7635dbb5e..f4b03891f 100644 --- a/lib/portage/util/futures/_asyncio/__init__.py +++ b/lib/portage/util/futures/_asyncio/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2018 Gentoo Foundation +# Copyright 2018-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 __all__ = ( @@ -139,7 +139,7 @@ def create_subprocess_exec(*args, **kwargs): """ loop = _wrap_loop(kwargs.pop('loop', None)) kwargs.setdefault('close_fds', _close_fds_default) - if _asyncio_enabled and isinstance(loop, _AsyncioEventLoop): + if _asyncio_enabled and isinstance(loop._asyncio_wrapper, _AsyncioEventLoop): # Use the real asyncio create_subprocess_exec (loop argument # is deprecated since since Python 3.8). return _real_asyncio.create_subprocess_exec(*args, **kwargs) @@ -191,10 +191,10 @@ def ensure_future(coro_or_future, loop=None): @return: an instance of Future """ loop = _wrap_loop(loop) - if _asyncio_enabled and isinstance(loop, _AsyncioEventLoop): + if _asyncio_enabled and isinstance(loop._asyncio_wrapper, _AsyncioEventLoop): # Use the real asyncio loop and ensure_future. return _real_asyncio.ensure_future( - coro_or_future, loop=loop._loop) + coro_or_future, loop=loop._asyncio_wrapper._loop) if isinstance(coro_or_future, Future): return coro_or_future