2017-02-07 04:55:37 +00:00
|
|
|
"""
|
|
|
|
categories: Core,import
|
|
|
|
description: Failed to load modules are still registered as loaded
|
2017-05-02 11:12:52 +00: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-07 04:55:37 +00:00
|
|
|
"""
|
|
|
|
import sys
|
|
|
|
|
|
|
|
try:
|
|
|
|
from modules import foo
|
|
|
|
except NameError as e:
|
|
|
|
print(e)
|
|
|
|
try:
|
|
|
|
from modules import foo
|
2020-03-23 02:26:08 +00:00
|
|
|
|
|
|
|
print("Should not get here")
|
2017-02-07 04:55:37 +00:00
|
|
|
except NameError as e:
|
|
|
|
print(e)
|