Skip to content

Commit 8ac72b9

Browse files
committed
Add testcase for failing namespace switch throwing exception from a module.
Issue adafruit#290. This currently fails, to draw attention to the issue.
1 parent 9307ef4 commit 8ac72b9

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

tests/basics/import1b.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
var = 123
2+
3+
def throw():
4+
raise ValueError

tests/basics/try-module.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Regression test for #290 - throwing exception in another module led to
2+
# its namespace stick and namespace of current module not coming back.
3+
import import1b
4+
5+
def func1():
6+
return
7+
8+
def func2():
9+
try:
10+
import1b.throw()
11+
except ValueError:
12+
pass
13+
func1()
14+
15+
func2()

0 commit comments

Comments
 (0)