Skip to content

Commit 03f3c0d

Browse files
committed
Added unbuffered output support for python tools subcommands
1 parent fd9dc7b commit 03f3c0d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mbed/mbed.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,7 @@ def compile(toolchain=None, mcu=None, source=False, build=False, compile_library
17571757
if not build:
17581758
build = os.path.join(os.path.relpath(program.path, orig_path), '.build/tests', target, tchain)
17591759

1760-
popen(['python', os.path.join(tools_dir, 'test.py')]
1760+
popen(['python', '-u', os.path.join(tools_dir, 'test.py')]
17611761
+ list(chain.from_iterable(izip(repeat('-D'), macros)))
17621762
+ ['-t', tchain, '-m', target]
17631763
+ list(chain.from_iterable(izip(repeat('--source'), source)))
@@ -1771,7 +1771,7 @@ def compile(toolchain=None, mcu=None, source=False, build=False, compile_library
17711771
if not build:
17721772
build = os.path.join(os.path.relpath(program.path, orig_path), '.build', 'libraries', os.path.basename(orig_path), target, tchain)
17731773

1774-
popen(['python', os.path.join(tools_dir, 'build.py')]
1774+
popen(['python', '-u', os.path.join(tools_dir, 'build.py')]
17751775
+ list(chain.from_iterable(izip(repeat('-D'), macros)))
17761776
+ ['-t', tchain, '-m', target]
17771777
+ list(chain.from_iterable(izip(repeat('--source'), source)))
@@ -1784,7 +1784,7 @@ def compile(toolchain=None, mcu=None, source=False, build=False, compile_library
17841784
if not build:
17851785
build = os.path.join(os.path.relpath(program.path, orig_path), '.build', target, tchain)
17861786

1787-
popen(['python', os.path.join(tools_dir, 'make.py')]
1787+
popen(['python', '-u', os.path.join(tools_dir, 'make.py')]
17881788
+ list(chain.from_iterable(izip(repeat('-D'), macros)))
17891789
+ ['-t', tchain, '-m', target]
17901790
+ list(chain.from_iterable(izip(repeat('--source'), source)))
@@ -1813,7 +1813,7 @@ def test(tlist=False):
18131813
if tlist:
18141814
# List all available tests (by default in a human-readable format)
18151815
try:
1816-
popen(['python', os.path.join(tools_dir, 'test.py'), '-l'] + args, env=env)
1816+
popen(['python', '-u', os.path.join(tools_dir, 'test.py'), '-l'] + args, env=env)
18171817
except ProcessException:
18181818
error('Failed to run test script')
18191819

@@ -1836,7 +1836,7 @@ def export(ide=None, mcu=None):
18361836

18371837
env = os.environ.copy()
18381838
env['PYTHONPATH'] = '.'
1839-
popen(['python', os.path.join(tools_dir, 'project.py')]
1839+
popen(['python', '-u', os.path.join(tools_dir, 'project.py')]
18401840
+ list(chain.from_iterable(izip(repeat('-D'), macros)))
18411841
+ ['-i', ide, '-m', target, '--source=%s' % program.path]
18421842
+ args,

0 commit comments

Comments
 (0)