Skip to content

Commit

Permalink
py/builtinimport: Fix unix port build with external imports disabled.
Browse files Browse the repository at this point in the history
Without this, building the unix port variants gives:
ports/unix/main.c:667: undefined reference to `mp_obj_is_package',
when MICROPY_ENABLE_EXTERNAL_IMPORT is 0.

Signed-off-by: Laurens Valk <[email protected]>
  • Loading branch information
laurensvalk authored and dpgeorge committed Mar 10, 2023
1 parent 78dc2db commit f3a596d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions py/builtinimport.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,10 @@ mp_obj_t mp_builtin___import___default(size_t n_args, const mp_obj_t *args) {

#else // MICROPY_ENABLE_EXTERNAL_IMPORT

bool mp_obj_is_package(mp_obj_t module) {
return false;
}

mp_obj_t mp_builtin___import___default(size_t n_args, const mp_obj_t *args) {
// Check that it's not a relative import
if (n_args >= 5 && MP_OBJ_SMALL_INT_VALUE(args[4]) != 0) {
Expand Down

0 comments on commit f3a596d

Please sign in to comment.