Page 1 of 1

Precedence of frozen bytecode

Posted: Sun Mar 15, 2020 1:46 am
by Hanilein
Hello,

after having managed to freeze modules and deploy them to a Pyboard, I found, that the frozen module is always used, even when an module with the same name is available on the SD-card.

That poses a slight challenge: In case of improvements or patches the firmware has to be updated, it is not possible to 'patch' a faulty or insufficient module by just supplying the module with the same name on the SD-card.

Is there a solution available?

Thank you very much.

Re: Precedence of frozen bytecode

Posted: Sun Mar 15, 2020 2:10 am
by dhylands

Re: Precedence of frozen bytecode

Posted: Sun Mar 15, 2020 2:54 am
by Hanilein
Thanks, Dave!

Lightning fast response, and it works like a charm.

I put this at the start of the main.py:

Code: Select all

import sys
sys.path[0]='/sd'
sys.path[1]=''
This reverses the order.

Thanks a lot!