mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 13:10:21 +01:00
py: Add config option to print warnings/errors to stderr.
This adds a new configuration option to print runtime warnings and errors to stderr. On Unix, CPython prints warnings and unhandled exceptions to stderr, so the unix port here is configured to use this option. The unix port already printed unhandled exceptions on the main thread to stderr. This patch fixes unhandled exceptions on other threads and warnings (issue #2838) not printing on stderr. Additionally, a couple tests needed to be fixed to handle this new behavior. This is done by also capturing stderr when running tests.
This commit is contained in:
committed by
Damien George
parent
9d836fedbd
commit
62849b7010
@@ -103,7 +103,7 @@ def run_micropython(pyb, args, test_file, is_special=False):
|
||||
os.close(master)
|
||||
os.close(slave)
|
||||
else:
|
||||
output_mupy = subprocess.check_output(args + [test_file])
|
||||
output_mupy = subprocess.check_output(args + [test_file], stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError:
|
||||
return b'CRASH'
|
||||
|
||||
@@ -124,7 +124,7 @@ def run_micropython(pyb, args, test_file, is_special=False):
|
||||
|
||||
# run the actual test
|
||||
try:
|
||||
output_mupy = subprocess.check_output(cmdlist)
|
||||
output_mupy = subprocess.check_output(cmdlist, stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError:
|
||||
output_mupy = b'CRASH'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user