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.
This commit is contained in:
parent
a90b080328
commit
347f20d4be
|
@ -5,8 +5,8 @@ import os
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
from operator import add
|
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
|
from itertools import chain
|
||||||
|
|
||||||
from powerline import Powerline
|
from powerline import Powerline
|
||||||
|
|
||||||
|
@ -64,9 +64,12 @@ class FSTree(object):
|
||||||
)
|
)
|
||||||
if os.environ.get('POWERLINE_RUN_LINT_DURING_TESTS'):
|
if os.environ.get('POWERLINE_RUN_LINT_DURING_TESTS'):
|
||||||
try:
|
try:
|
||||||
check_call(['scripts/powerline-lint'] + reduce(add, (
|
check_call(chain(['scripts/powerline-lint'], *[
|
||||||
['-p', d] for d in self.p.get_config_paths()
|
('-p', d) for d in (
|
||||||
)))
|
self.p.get_config_paths() if self.p
|
||||||
|
else self.get_config_paths(self.root)
|
||||||
|
)
|
||||||
|
]))
|
||||||
except:
|
except:
|
||||||
self.__exit__()
|
self.__exit__()
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in New Issue