From 347f20d4be5a1c77357eded43dfa1ea00a781b82 Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 7 Jan 2015 19:06:08 +0300 Subject: [PATCH] Refactor FSTree to not use reduce as it is not present in Python-3 I.e. it is not builtin and requires heavy variant with trying to import it from functools. --- tests/lib/fsconfig.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/lib/fsconfig.py b/tests/lib/fsconfig.py index a1066f65..248a3a70 100644 --- a/tests/lib/fsconfig.py +++ b/tests/lib/fsconfig.py @@ -5,8 +5,8 @@ import os import json from subprocess import check_call -from operator import add from shutil import rmtree +from itertools import chain from powerline import Powerline @@ -64,9 +64,12 @@ class FSTree(object): ) if os.environ.get('POWERLINE_RUN_LINT_DURING_TESTS'): try: - check_call(['scripts/powerline-lint'] + reduce(add, ( - ['-p', d] for d in self.p.get_config_paths() - ))) + check_call(chain(['scripts/powerline-lint'], *[ + ('-p', d) for d in ( + self.p.get_config_paths() if self.p + else self.get_config_paths(self.root) + ) + ])) except: self.__exit__() raise