mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
Add testcase for failing namespace switch throwing exception from a module.
Issue #290. This currently fails, to draw attention to the issue.
This commit is contained in:
@@ -1 +1,4 @@
|
||||
var = 123
|
||||
|
||||
def throw():
|
||||
raise ValueError
|
||||
|
||||
15
tests/basics/try-module.py
Normal file
15
tests/basics/try-module.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Regression test for #290 - throwing exception in another module led to
|
||||
# its namespace stick and namespace of current module not coming back.
|
||||
import import1b
|
||||
|
||||
def func1():
|
||||
return
|
||||
|
||||
def func2():
|
||||
try:
|
||||
import1b.throw()
|
||||
except ValueError:
|
||||
pass
|
||||
func1()
|
||||
|
||||
func2()
|
||||
Reference in New Issue
Block a user