1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 20:19:23 +00:00
trezor-firmware/src/trezor/utils.py

13 lines
296 B
Python
Raw Normal View History

2016-04-26 23:32:57 +00:00
import sys
import gc
2016-04-11 17:39:01 +00:00
2016-04-26 23:32:57 +00:00
def unimport(func):
def inner(*args, **kwargs):
mods = set(sys.modules)
ret = func(*args, **kwargs)
for to_remove in set(sys.modules) - mods:
print(to_remove)
del sys.modules[to_remove]
return ret
return inner