2017-02-06 23:55:37 -05:00
|
|
|
"""
|
|
|
|
categories: Core,import
|
|
|
|
description: Failed to load modules are still registered as loaded
|
2017-05-02 07:12:52 -04:00
|
|
|
cause: To make module handling more efficient, it's not wrapped with exception handling.
|
|
|
|
workaround: Test modules before production use; during development, use ``del sys.modules["name"]``, or just soft or hard reset the board.
|
2017-02-06 23:55:37 -05:00
|
|
|
"""
|
|
|
|
import sys
|
|
|
|
|
|
|
|
try:
|
|
|
|
from modules import foo
|
|
|
|
except NameError as e:
|
|
|
|
print(e)
|
|
|
|
try:
|
|
|
|
from modules import foo
|
2020-03-22 22:26:08 -04:00
|
|
|
|
2017-02-06 23:55:37 -05:00
|
|
|
print("Should not get here")
|
|
|
|
except NameError as e:
|
|
|
|
print(e)
|