Skip to content

Commit 26664dd

Browse files
blmorrispfalcon
authored andcommitted
unix/mpconfigport.h: set MICROPY_PY_SYS_PLATFORM to "darwin" if compiled on OSX
This change allows micropython to return the same value as CPython for sys.platform
1 parent 4434e43 commit 26664dd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

unix/mpconfigport.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@
7373
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
7474
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
7575
#define MICROPY_PY_SYS_EXIT (1)
76-
#define MICROPY_PY_SYS_PLATFORM "linux"
76+
#if defined(__APPLE__) && defined(__MACH__)
77+
#define MICROPY_PY_SYS_PLATFORM "darwin"
78+
#else
79+
#define MICROPY_PY_SYS_PLATFORM "linux"
80+
#endif
7781
#define MICROPY_PY_SYS_MAXSIZE (1)
7882
#define MICROPY_PY_SYS_STDFILES (1)
7983
#define MICROPY_PY_SYS_EXC_INFO (1)

0 commit comments

Comments
 (0)