diff options
| author | Damien George <damien.p.george@gmail.com> | 2019-04-26 15:22:14 +1000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2019-04-26 15:22:14 +1000 |
| commit | 0646e607b537b43901db53c743ec2011a375f5e2 (patch) | |
| tree | c5049313f11beabef7936d1ec264f0416cdee6d0 /ports/esp32/main.c | |
| parent | 06a532c227c2f37fc190deb84970fdfeaaf37d6a (diff) | |
ports: Convert to use pyexec_file_if_exists() to execute boot/main.py.
The stm32 and nrf ports already had the behaviour that they would first
check if the script exists before executing it, and this patch makes all
other ports work the same way. This helps when developing apps because
it's hard to tell (when unconditionally trying to execute the scripts) if
the resulting OSError at boot up comes from missing boot.py or main.py, or
from some other error. And it's not really an error if these scripts don't
exist.
Diffstat (limited to 'ports/esp32/main.c')
| -rw-r--r-- | ports/esp32/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/esp32/main.c b/ports/esp32/main.c index 188fb5e70..d4f79646f 100644 --- a/ports/esp32/main.c +++ b/ports/esp32/main.c @@ -111,9 +111,9 @@ soft_reset: // run boot-up scripts pyexec_frozen_module("_boot.py"); - pyexec_file("boot.py"); + pyexec_file_if_exists("boot.py"); if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) { - pyexec_file("main.py"); + pyexec_file_if_exists("main.py"); } for (;;) { |
