Skip to content

Commit 413398a

Browse files
tiranbrettcannon
andcommitted
Apply suggestions from code review
Co-authored-by: Brett Cannon <[email protected]>
1 parent 934bad8 commit 413398a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Lib/test/support/threading_helper.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,22 +210,23 @@ def __exit__(self, *exc_info):
210210

211211

212212
def _can_start_thread() -> bool:
213-
"""Detect if Python can start new threads
213+
"""Detect if Python can start new threads.
214214
215215
Some WebAssembly platforms do not provide a working pthread
216216
implementation. Thread support is stubbed and any attempt
217217
to create a new thread fails.
218218
219-
- wasm32-wasi does not have threading
219+
- wasm32-wasi does not have threading.
220220
- wasm32-emscripten can be compiled with or without pthread
221-
support. (-s USE_PTHREADS / __EMSCRIPTEN_PTHREADS__).
221+
support (-s USE_PTHREADS / __EMSCRIPTEN_PTHREADS__).
222222
"""
223223
if sys.platform == "emscripten":
224224
try:
225225
_thread.start_new_thread(lambda: None, ())
226226
except RuntimeError:
227227
return False
228-
return True
228+
else:
229+
return True
229230
elif sys.platform == "wasi":
230231
return False
231232
else:

0 commit comments

Comments
 (0)