summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-07-19 22:36:15 +1000
committerDamien George <damien@micropython.org>2024-07-20 12:32:31 +1000
commit8159dcc276dc07bcb28d6ab3a3b7d2a5c1d90ab5 (patch)
tree1cd87e3fecb81eff695899ea01e854e048f70956
parent5f3ecc29f8f0d69d15710ded3278fe055f532517 (diff)
extmod/modos: Include os.sep entry if MICROPY_VFS is enabled.
This simplifies configuration by removing the `MICROPY_PY_OS_SEP` option and instead including `os.sep` if `MICROPY_VFS` is enabled. That matches the configuration of all existing ports that enabled `os.sep` (they also had `MICROPY_VFS` enabled), and brings consistency to other ports. Fixes issue #15116. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--extmod/modos.c4
-rw-r--r--ports/nrf/mpconfigport.h1
-rw-r--r--ports/renesas-ra/mpconfigport.h1
-rw-r--r--ports/stm32/mpconfigport.h1
-rw-r--r--ports/unix/variants/mpconfigvariant_common.h1
-rw-r--r--ports/windows/mpconfigport.h1
6 files changed, 1 insertions, 8 deletions
diff --git a/extmod/modos.c b/extmod/modos.c
index 7f1e31fba..e7f7fc818 100644
--- a/extmod/modos.c
+++ b/extmod/modos.c
@@ -153,9 +153,6 @@ static const mp_rom_map_elem_t os_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_putenv), MP_ROM_PTR(&mp_os_putenv_obj) },
{ MP_ROM_QSTR(MP_QSTR_unsetenv), MP_ROM_PTR(&mp_os_unsetenv_obj) },
#endif
- #if MICROPY_PY_OS_SEP
- { MP_ROM_QSTR(MP_QSTR_sep), MP_ROM_QSTR(MP_QSTR__slash_) },
- #endif
#if MICROPY_PY_OS_SYNC
{ MP_ROM_QSTR(MP_QSTR_sync), MP_ROM_PTR(&mp_os_sync_obj) },
#endif
@@ -170,6 +167,7 @@ static const mp_rom_map_elem_t os_module_globals_table[] = {
#endif
#if MICROPY_VFS
+ { MP_ROM_QSTR(MP_QSTR_sep), MP_ROM_QSTR(MP_QSTR__slash_) },
{ MP_ROM_QSTR(MP_QSTR_chdir), MP_ROM_PTR(&mp_vfs_chdir_obj) },
{ MP_ROM_QSTR(MP_QSTR_getcwd), MP_ROM_PTR(&mp_vfs_getcwd_obj) },
{ MP_ROM_QSTR(MP_QSTR_listdir), MP_ROM_PTR(&mp_vfs_listdir_obj) },
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h
index 0b9b667ee..48b58143a 100644
--- a/ports/nrf/mpconfigport.h
+++ b/ports/nrf/mpconfigport.h
@@ -151,7 +151,6 @@
#define MICROPY_PY_OS_INCLUDEFILE "ports/nrf/modules/os/modos.c"
#define MICROPY_PY_OS_DUPTERM (1)
#define MICROPY_PY_OS_DUPTERM_STREAM_DETACHED_ATTACHED (1)
-#define MICROPY_PY_OS_SEP (1)
#define MICROPY_PY_OS_SYNC (MICROPY_VFS)
#define MICROPY_PY_OS_UNAME (1)
#define MICROPY_PY_OS_URANDOM (MICROPY_HW_ENABLE_RNG)
diff --git a/ports/renesas-ra/mpconfigport.h b/ports/renesas-ra/mpconfigport.h
index 52effd64f..a23a2c106 100644
--- a/ports/renesas-ra/mpconfigport.h
+++ b/ports/renesas-ra/mpconfigport.h
@@ -120,7 +120,6 @@
#define MICROPY_PY_OS_DUPTERM (3)
#define MICROPY_PY_OS_DUPTERM_BUILTIN_STREAM (1)
#define MICROPY_PY_OS_DUPTERM_STREAM_DETACHED_ATTACHED (1)
-#define MICROPY_PY_OS_SEP (1)
#define MICROPY_PY_OS_SYNC (1)
#define MICROPY_PY_OS_UNAME (1)
#define MICROPY_PY_OS_URANDOM (MICROPY_HW_ENABLE_RNG)
diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h
index bd1ab671e..25fc9e11f 100644
--- a/ports/stm32/mpconfigport.h
+++ b/ports/stm32/mpconfigport.h
@@ -99,7 +99,6 @@
#define MICROPY_PY_OS_DUPTERM (3)
#define MICROPY_PY_OS_DUPTERM_BUILTIN_STREAM (1)
#define MICROPY_PY_OS_DUPTERM_STREAM_DETACHED_ATTACHED (1)
-#define MICROPY_PY_OS_SEP (1)
#define MICROPY_PY_OS_SYNC (1)
#define MICROPY_PY_OS_UNAME (1)
#define MICROPY_PY_OS_URANDOM (MICROPY_HW_ENABLE_RNG)
diff --git a/ports/unix/variants/mpconfigvariant_common.h b/ports/unix/variants/mpconfigvariant_common.h
index 2e34055bf..cea039741 100644
--- a/ports/unix/variants/mpconfigvariant_common.h
+++ b/ports/unix/variants/mpconfigvariant_common.h
@@ -95,7 +95,6 @@
#define MICROPY_PY_OS_INCLUDEFILE "ports/unix/modos.c"
#define MICROPY_PY_OS_ERRNO (1)
#define MICROPY_PY_OS_GETENV_PUTENV_UNSETENV (1)
-#define MICROPY_PY_OS_SEP (1)
#define MICROPY_PY_OS_SYSTEM (1)
#define MICROPY_PY_OS_URANDOM (1)
diff --git a/ports/windows/mpconfigport.h b/ports/windows/mpconfigport.h
index 55e44c6f5..fabc9072d 100644
--- a/ports/windows/mpconfigport.h
+++ b/ports/windows/mpconfigport.h
@@ -136,7 +136,6 @@
#define MICROPY_PY_OS_INCLUDEFILE "ports/unix/modos.c"
#define MICROPY_PY_OS_ERRNO (1)
#define MICROPY_PY_OS_GETENV_PUTENV_UNSETENV (1)
-#define MICROPY_PY_OS_SEP (1)
#define MICROPY_PY_OS_STATVFS (0)
#define MICROPY_PY_OS_SYSTEM (1)
#define MICROPY_PY_OS_URANDOM (1)