diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h
index a0040177970f5aa86bb1c978bdb5b90dd1636854..ccc3d4af2f16ce0a9912579e5114fe93ae947c8b 100644
--- a/unix/mpconfigport.h
+++ b/unix/mpconfigport.h
@@ -73,7 +73,11 @@
 #define MICROPY_PY_ALL_SPECIAL_METHODS (1)
 #define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
 #define MICROPY_PY_SYS_EXIT         (1)
-#define MICROPY_PY_SYS_PLATFORM     "linux"
+#if defined(__APPLE__) && defined(__MACH__)
+    #define MICROPY_PY_SYS_PLATFORM  "darwin"
+#else
+    #define MICROPY_PY_SYS_PLATFORM  "linux"
+#endif
 #define MICROPY_PY_SYS_MAXSIZE      (1)
 #define MICROPY_PY_SYS_STDFILES     (1)
 #define MICROPY_PY_SYS_EXC_INFO     (1)