Comment 6 for bug 704981

Revision history for this message
Tsung-Hsiang Chang (vgod) wrote : Re: [request] IDE: want a reset feature to get import repeated

I just realized it's hard to fix this issue shortly. This issue involves with a bug of Jython that I reported long time ago but got no response. As a result, Sikuli IDE has to recycle the same Python interpreter to run scripts every time. Under this condition, the only solution I can come up with now is to monitor what modules are imported by users and delete them from sys.modules before running the user's scripts. (See the following workaround.)

If you have a list of the modules needed to be reload, you can put the following code in front of the main script to reload all of them without writing many reloads.

for m in["mod1", "mod2", "mod3", ...]:
    if m in sys.modules:
        del sys.modules[m]

import mod1, mod2, mod3