From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BC03613888F for ; Mon, 12 Oct 2015 04:36:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6DF47E086B; Mon, 12 Oct 2015 04:36:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8DF69E07C5 for ; Mon, 12 Oct 2015 04:36:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id D07F733FA71 for ; Mon, 12 Oct 2015 04:36:06 +0000 (UTC) From: Mike Frysinger To: gentoo-catalyst@lists.gentoo.org Subject: [gentoo-catalyst] [PATCH 5/9] genbase: use sorted() with dict keys Date: Mon, 12 Oct 2015 00:35:58 -0400 Message-Id: <1444624562-26162-5-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 2.5.2 In-Reply-To: <1444624562-26162-1-git-send-email-vapier@gentoo.org> References: <1444624562-26162-1-git-send-email-vapier@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Archives-Salt: 9bde313f-e7ac-414d-951a-12ca35515246 X-Archives-Hash: 914e34f40b1fc279e2b30a691cffe516 In py3, the dict keys func returns a view which doesn't have a sort member. Pass the result through sorted() which works with py2 and py3. --- catalyst/base/genbase.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py index a33f924..8a1af8d 100644 --- a/catalyst/base/genbase.py +++ b/catalyst/base/genbase.py @@ -22,8 +22,7 @@ class GenBase(object): keys={} for i in self.settings["contents"].split(): keys[i]=1 - array=keys.keys() - array.sort() + array = sorted(keys.keys()) for j in array: contents = contents_map.contents(path, j, verbose=self.settings["VERBOSE"]) @@ -42,8 +41,7 @@ class GenBase(object): keys={} for i in self.settings["digests"].split(): keys[i]=1 - array=keys.keys() - array.sort() + array = sorted(keys.keys()) for f in [path, path + '.CONTENTS']: if os.path.exists(f): if "all" in array: -- 2.5.2