Skip to content

Commit 28109f0

Browse files
committed
Update LVGL
Use usys.print_exception instead of sys.exc_info, see micropython/micropython#6471
1 parent e225c4b commit 28109f0

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

lib/lv_utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,5 @@ async def async_timer(self):
153153

154154

155155
def default_exception_sink(self, e):
156-
exc = usys.exc_info()
157-
print('ERROR! %s: %s\n%s' % (
158-
exc[0].__name__,
159-
exc[1],
160-
exc[2] if exc[2] else ''))
156+
usys.print_exception(e)
157+
event_loop.current_instance().deinit()

lvgl

Submodule lvgl updated 58 files

tests/run_test.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
DELAY_MS=25
2323
MAX_CHILDREN=100
2424

25-
import sys
26-
sys.path.append('') # See: https://github.com/micropython/micropython/issues/6419
25+
import usys
26+
usys.path.append('') # See: https://github.com/micropython/micropython/issues/6419
2727

2828
import gc
2929
import os
@@ -78,7 +78,7 @@ def send_events():
7878

7979
def run():
8080
try:
81-
script = sys.argv[1]
81+
script = usys.argv[1]
8282
script_path = script[:script.rfind('/')] if script.find('/') >= 0 else '.'
8383
script_name = script[script.rfind('/')+1:] if script.find('/') >= 0 else script
8484

@@ -87,8 +87,8 @@ def run():
8787
with open(script, 'r') as file:
8888
file_string = file.read()
8989
os.chdir(script_path)
90-
sys.argv[0] = script_name
91-
del sys.argv[1]
90+
usys.argv[0] = script_name
91+
del usys.argv[1]
9292
exec(file_string, {'__file__': script_name, 'lv': lv})
9393
time.sleep_ms(DELAY_MS)
9494
gc.collect()
@@ -100,13 +100,8 @@ def run():
100100
lv_utils.event_loop.current_instance().deinit()
101101
time.sleep_ms(DELAY_MS)
102102

103-
except:
104-
exc = sys.exc_info()
105-
print('ERROR! %s: %s\n%s' % (
106-
exc[0].__name__,
107-
exc[1],
108-
exc[2] if exc[2] else ''))
109-
110-
sys.exit(255) # 255 to exit xargs
103+
except Exception as e:
104+
usys.print_exception(e)
105+
usys.exit(255) # 255 to exit xargs
111106

112107
run()

0 commit comments

Comments
 (0)