From 24e8e9337cf674fc99d2398e6c2e72a52fa0c60a Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 26 Apr 2015 18:20:09 +0200 Subject: [PATCH] Replace map() with list comprehensions As a bonus this removes a use of string.strip (not in python3). Signed-off-by: Julien Cristau --- britney.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/britney.py b/britney.py index 62af5bd..8468846 100755 --- a/britney.py +++ b/britney.py @@ -183,7 +183,6 @@ from __future__ import print_function import os import sys -import string import time import optparse import urllib @@ -389,7 +388,7 @@ class Britney(object): arches += [x for x in allarches if x not in arches and x not in self.options.break_arches.split()] arches += [x for x in allarches if x not in arches and x not in self.options.new_arches.split()] arches += [x for x in allarches if x not in arches] - self.options.architectures = map(intern, arches) + self.options.architectures = [intern(arch) for arch in arches] self.options.smooth_updates = self.options.smooth_updates.split() def __log(self, msg, type="I"): @@ -641,7 +640,7 @@ class Britney(object): # register virtual packages and real packages that provide them if dpkg[PROVIDES]: - parts = map(string.strip, dpkg[PROVIDES].split(",")) + parts = [p.strip() for p in dpkg[PROVIDES].split(",")] for p in parts: if p not in provides: provides[p] = []