Skip to content

Commit 5d3ed7b

Browse files
committed
Replaced list(zip with zip and a future import
1 parent e1c2e12 commit 5d3ed7b

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

mbed/mbed.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# pylint: disable=invalid-name, missing-docstring, bad-continuation
2020

2121
from __future__ import print_function
22+
from future.builtins.iterators import zip
2223
from past.builtins import basestring
2324

2425
try:
@@ -2476,8 +2477,8 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
24762477
# Compile configuration
24772478
popen([python_cmd, os.path.join(tools_dir, 'get_config.py')]
24782479
+ ['-t', tchain, '-m', target]
2479-
+ list(chain.from_iterable(list(zip(repeat('--profile'), profile or []))))
2480-
+ list(chain.from_iterable(list(zip(repeat('--source'), source))))
2480+
+ list(chain.from_iterable(zip(repeat('--profile'), profile or [])))
2481+
+ list(chain.from_iterable(zip(repeat('--source'), source)))
24812482
+ (['-v'] if verbose else [])
24822483
+ (list(chain.from_iterable(izip(repeat('--prefix'), config_prefix))) if config_prefix else []),
24832484
env=env)
@@ -2494,10 +2495,10 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
24942495
build_path = os.path.join(os.path.relpath(program.path, orig_path), program.build_dir, 'libraries', os.path.basename(orig_path), target, tchain)
24952496

24962497
popen([python_cmd, '-u', os.path.join(tools_dir, 'build.py')]
2497-
+ list(chain.from_iterable(list(zip(repeat('-D'), macros))))
2498+
+ list(chain.from_iterable(zip(repeat('-D'), macros)))
24982499
+ ['-t', tchain, '-m', target]
2499-
+ list(chain.from_iterable(list(zip(repeat('--profile'), profile or []))))
2500-
+ list(chain.from_iterable(list(zip(repeat('--source'), source))))
2500+
+ list(chain.from_iterable(zip(repeat('--profile'), profile or [])))
2501+
+ list(chain.from_iterable(zip(repeat('--source'), source)))
25012502
+ ['--build', build_path]
25022503
+ (['-c'] if clean else [])
25032504
+ (['--artifact-name', artifact_name] if artifact_name else [])
@@ -2510,10 +2511,10 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
25102511
build_path = os.path.join(os.path.relpath(program.path, orig_path), program.build_dir, target, tchain)
25112512

25122513
popen([python_cmd, '-u', os.path.join(tools_dir, 'make.py')]
2513-
+ list(chain.from_iterable(list(zip(repeat('-D'), macros))))
2514+
+ list(chain.from_iterable(zip(repeat('-D'), macros)))
25142515
+ ['-t', tchain, '-m', target]
2515-
+ list(chain.from_iterable(list(zip(repeat('--profile'), profile or []))))
2516-
+ list(chain.from_iterable(list(zip(repeat('--source'), source))))
2516+
+ list(chain.from_iterable(zip(repeat('--profile'), profile or [])))
2517+
+ list(chain.from_iterable(zip(repeat('--source'), source)))
25172518
+ ['--build', build_path]
25182519
+ (['-c'] if clean else [])
25192520
+ (['--artifact-name', artifact_name] if artifact_name else [])
@@ -2602,7 +2603,7 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
26022603
popen([python_cmd, '-u', os.path.join(tools_dir, 'test.py'), '--list']
26032604
+ list(chain.from_iterable(list(izip(repeat('--profile'), profile or []))))
26042605
+ ['-t', tchain, '-m', target]
2605-
+ list(chain.from_iterable(list(zip(repeat('--source'), source))))
2606+
+ list(chain.from_iterable(zip(repeat('--source'), source)))
26062607
+ (['-n', tests_by_name] if tests_by_name else [])
26072608
+ (['-v'] if verbose else [])
26082609
+ (['--app-config', app_config] if app_config else [])
@@ -2616,11 +2617,11 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
26162617
program.ignore_build_dir()
26172618

26182619
popen([python_cmd, '-u', os.path.join(tools_dir, 'test.py')]
2619-
+ list(chain.from_iterable(list(zip(repeat('-D'), macros))))
2620-
+ list(chain.from_iterable(list(zip(repeat('--profile'), profile or []))))
2620+
+ list(chain.from_iterable(zip(repeat('-D'), macros)))
2621+
+ list(chain.from_iterable(zip(repeat('--profile'), profile or [])))
26212622
+ ['-t', tchain, '-m', target]
26222623
+ (['-c'] if clean else [])
2623-
+ list(chain.from_iterable(list(zip(repeat('--source'), source))))
2624+
+ list(chain.from_iterable(zip(repeat('--source'), source)))
26242625
+ ['--build', build_path]
26252626
+ ['--test-spec', test_spec]
26262627
+ (['-n', tests_by_name] if tests_by_name else [])

0 commit comments

Comments
 (0)