Skip to content

Throwing exceptions across modules causes namespace issues #290

Closed
@pfalcon

Description

@pfalcon

Testcase:

$ cat submod.py 
def foo():
    raise OSError

$ cat testcase2.py 
import submod

def func1():
    return

def func2():
    try:
        submod.foo()
    except OSError:
        pass
    func1()

func2()

$ micropython testcase2.py 
Traceback (most recent call last):
  File "testcase2.py", line 14, in <module>
  File "testcase2.py", line 11, in func2
NameError: name 'func1' is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions