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 BEAA41382C5 for ; Sun, 8 Apr 2018 21:18:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D012DE0B11; Sun, 8 Apr 2018 21:18:25 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 AB964E0B11 for ; Sun, 8 Apr 2018 21:18:25 +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 6D53F335C51 for ; Sun, 8 Apr 2018 21:18:24 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 818D726D for ; Sun, 8 Apr 2018 21:18:22 +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: <1523222139.13621b62e32a7c21aa08247b33f1faa0a146d0d4.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/_eventloop/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/_eventloop/EventLoop.py X-VCS-Directories: pym/portage/util/_eventloop/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 13621b62e32a7c21aa08247b33f1faa0a146d0d4 X-VCS-Branch: master Date: Sun, 8 Apr 2018 21:18:22 +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-Archives-Salt: d45f1878-8eb8-45ee-b577-7c1c292d1c12 X-Archives-Hash: 36c35d764e8ea559921d56396ca9cfa3 commit: 13621b62e32a7c21aa08247b33f1faa0a146d0d4 Author: Zac Medico gentoo org> AuthorDate: Sun Apr 8 21:15:39 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Apr 8 21:15:39 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=13621b62 EventLoop: add get/set_debug methods for asyncio compat (bug 591760) Bug: https://bugs.gentoo.org/591760 pym/portage/util/_eventloop/EventLoop.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pym/portage/util/_eventloop/EventLoop.py b/pym/portage/util/_eventloop/EventLoop.py index 1574a6837..4ec67241f 100644 --- a/pym/portage/util/_eventloop/EventLoop.py +++ b/pym/portage/util/_eventloop/EventLoop.py @@ -102,6 +102,7 @@ class EventLoop(object): @type main: bool """ self._use_signal = main and fcntl is not None + self._debug = bool(os.environ.get('PYTHONASYNCIODEBUG')) self._thread_rlock = threading.RLock() self._thread_condition = threading.Condition(self._thread_rlock) self._poll_event_queue = [] @@ -763,6 +764,19 @@ class EventLoop(object): close() self._poll_obj = None + def get_debug(self): + """ + Get the debug mode (bool) of the event loop. + + The default value is True if the environment variable + PYTHONASYNCIODEBUG is set to a non-empty string, False otherwise. + """ + return self._debug + + def set_debug(self, enabled): + """Set the debug mode of the event loop.""" + self._debug = enabled + _can_poll_device = None