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 663FC139085 for ; Wed, 8 Feb 2017 08:03:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 762B5E0C33; Wed, 8 Feb 2017 08:03:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 44A79E0C33 for ; Wed, 8 Feb 2017 08:03:17 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7468A3416C7 for ; Wed, 8 Feb 2017 08:03:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1888D3DCB for ; Wed, 8 Feb 2017 08:03:14 +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: <1486540341.a99414cc781b35d8089472f3c4d7916e4eeb494c.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/sync/, pym/portage/emaint/modules/sync/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/emaint/modules/sync/sync.py pym/portage/sync/controller.py X-VCS-Directories: pym/portage/emaint/modules/sync/ pym/portage/sync/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: a99414cc781b35d8089472f3c4d7916e4eeb494c X-VCS-Branch: master Date: Wed, 8 Feb 2017 08:03:14 +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: fce0d319-278b-4a33-927c-a08b0ddae608 X-Archives-Hash: 94858f5051974f62f91f79d895dbdd47 commit: a99414cc781b35d8089472f3c4d7916e4eeb494c Author: Zac Medico gentoo org> AuthorDate: Wed Feb 8 07:49:51 2017 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Feb 8 07:52:21 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a99414cc SyncManager: rename async method to sync_async (bug 607922) This fixes the following DeprecationWarning with Python 3.6: pym/portage/sync/controller.py:117: DeprecationWarning: 'async' and 'await' will become reserved keywords in Python 3.7 def async(self, emerge_config=None, repo=None, master_hooks=True): X-Gentoo-Bug: 607922 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=607922 pym/portage/emaint/modules/sync/sync.py | 4 ++-- pym/portage/sync/controller.py | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/pym/portage/emaint/modules/sync/sync.py b/pym/portage/emaint/modules/sync/sync.py index 076297a..c8d4ca1 100644 --- a/pym/portage/emaint/modules/sync/sync.py +++ b/pym/portage/emaint/modules/sync/sync.py @@ -1,4 +1,4 @@ -# Copyright 2014-2015 Gentoo Foundation +# Copyright 2014-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import logging @@ -434,7 +434,7 @@ class SyncScheduler(AsyncScheduler): self._running_repos.add(node) self._update_leaf_nodes() - return self._sync_manager.async( + return self._sync_manager.sync_async( emerge_config=self._emerge_config, repo=self._repo_map[node], master_hooks=self._master_hooks(node)) diff --git a/pym/portage/sync/controller.py b/pym/portage/sync/controller.py index 92be3cb..3bccf6f 100644 --- a/pym/portage/sync/controller.py +++ b/pym/portage/sync/controller.py @@ -1,4 +1,4 @@ -# Copyright 2014 Gentoo Foundation +# Copyright 2014-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@ -8,6 +8,7 @@ import sys import logging import grp import pwd +import warnings import portage from portage import os @@ -107,6 +108,14 @@ class SyncManager(object): level=logging.WARN, noiselevel=2) self.hooks[_dir] = hooks + def __getattr__(self, name): + if name == 'async': + warnings.warn("portage.sync.controller.SyncManager.async " + "has been renamed to sync_async", + DeprecationWarning, stacklevel=2) + return self.sync_async + else: + raise AttributeError(name) def get_module_descriptions(self, mod): desc = self.module_controller.get_func_descriptions(mod) @@ -114,7 +123,7 @@ class SyncManager(object): return desc return [] - def async(self, emerge_config=None, repo=None, master_hooks=True): + def sync_async(self, emerge_config=None, repo=None, master_hooks=True): self.emerge_config = emerge_config self.settings, self.trees, self.mtimedb = emerge_config self.xterm_titles = "notitles" not in self.settings.features