aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-10-11 22:18:17 -0400
committerMike Frysinger <vapier@gentoo.org>2015-10-11 22:18:17 -0400
commit986ef3f2a80c688059840d781d962bd3f3644538 (patch)
treec369ffcade42d0af153811fb8167a2aae55a2f55
parentlog: make sure NOTICE is an int (diff)
downloadcatalyst-986ef3f2a80c688059840d781d962bd3f3644538.tar.gz
catalyst-986ef3f2a80c688059840d781d962bd3f3644538.tar.bz2
catalyst-986ef3f2a80c688059840d781d962bd3f3644538.zip
genbase: use sorted() with dict keys
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.
-rw-r--r--catalyst/base/genbase.py6
1 files 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: