8000 windows: Improve default search path. · jeremyherbert/micropython@5f91933 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5f91933

Browse files
stinosdpgeorge
authored andcommitted
windows: Improve default search path.
The default value for MICROPYPATH used in unix/main.c is "~/.micropython/lib:/usr/lib/micropython" which has 2 problems when used in the Windows port: - it has a ':' as path separator but the port uses ';' so the entire string is effectively discarded since it gets interpreted as a single path which doesn't exist - /usr/lib/micropython is not a valid path in a standard Windows environment Override the value with a suitable default.
1 parent 8b6e600 commit 5f91933

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/unix/quickref.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ Environment variables
8282
.. envvar:: MICROPYPATH
8383

8484
Overrides the default search path for MicroPython libraries. ``MICROPYPATH``
85-
should be set to a colon separated list of directories. If ``MICROPYPATH`` is
86-
not defined, the search path will be ``~/.micropython/lib:/usr/lib/micropython``
85+
should be set to a colon (semicolon for Windows port) separated list of
86+
directories. If ``MICROPYPATH`` is not defined, the search path will be
87+
``~/.micropython/lib:/usr/lib/micropython`` (``~/.micropython/lib`` for Windows port)
8788
or the value of the ``MICROPY_PY_SYS_PATH_DEFAULT`` option if it was set
8889
when MicroPython itself was compiled.
8990

ports/windows/mpconfigport.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
8282
#define MICROPY_PY_SYS_EXIT (1)
8383
#define MICROPY_PY_SYS_PLATFORM "win32"
84+
#ifndef MICROPY_PY_SYS_PATH_DEFAULT
85+
#define MICROPY_PY_SYS_PATH_DEFAULT "~/.micropython/lib"
86+
#endif
8487
#define MICROPY_PY_SYS_MAXSIZE (1)
8588
#define MICROPY_PY_SYS_STDFILES (1)
8689
#define MICROPY_PY_SYS_EXC_INFO (1)

0 commit comments

Comments
 (0)
0