Path: blob/main/python/cpython/src/patches/14-threading-warning.patch
1067 views
--- native/Lib/threading.py 2022-10-24 10:35:391+++ wasm/Lib/threading.py 2022-11-15 09:41:012@@ -945,6 +945,13 @@3same thread object.45"""6+ # CoWasm -- if somehow something tries to actually start a thread, we just7+ # don't. CoWasm has no support for threads, but Python packages8+ # such as pip just assume it does. E.g., pip's progress bar uses threading,9+ # and showing this message is better than crashing pip.10+ print("(WARNING: threading is not supported)")11+ return12+13if not self._initialized:14raise RuntimeError("thread.__init__() not called")1516@@ -1101,6 +1108,8 @@17exception.1819"""20+ # CoWasm: we're making the thread a no-op, so it's done.21+ return22if not self._initialized:23raise RuntimeError("Thread.__init__() not called")24if not self._started.is_set():252627