Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/python/cpython/src/patches/14-threading-warning.patch
1067 views
1
--- native/Lib/threading.py 2022-10-24 10:35:39
2
+++ wasm/Lib/threading.py 2022-11-15 09:41:01
3
@@ -945,6 +945,13 @@
4
same thread object.
5
6
"""
7
+ # CoWasm -- if somehow something tries to actually start a thread, we just
8
+ # don't. CoWasm has no support for threads, but Python packages
9
+ # such as pip just assume it does. E.g., pip's progress bar uses threading,
10
+ # and showing this message is better than crashing pip.
11
+ print("(WARNING: threading is not supported)")
12
+ return
13
+
14
if not self._initialized:
15
raise RuntimeError("thread.__init__() not called")
16
17
@@ -1101,6 +1108,8 @@
18
exception.
19
20
"""
21
+ # CoWasm: we're making the thread a no-op, so it's done.
22
+ return
23
if not self._initialized:
24
raise RuntimeError("Thread.__init__() not called")
25
if not self._started.is_set():
26
27