MCPcopy
hub / github.com/urllib3/urllib3 / has_jspi

Function has_jspi

src/urllib3/contrib/emscripten/fetch.py:680–696  ·  view source on GitHub ↗

Return true if jspi can be used. This requires both browser support and also WebAssembly to be in the correct state - i.e. that the javascript call into python was async not sync. :return: True if jspi can be used. :rtype: bool

()

Source from the content-addressed store, hash-verified

678
679
680def has_jspi() -> bool:
681 """
682 Return true if jspi can be used.
683
684 This requires both browser support and also WebAssembly
685 to be in the correct state - i.e. that the javascript
686 call into python was async not sync.
687
688 :return: True if jspi can be used.
689 :rtype: bool
690 """
691 try:
692 from pyodide.ffi import can_run_sync, run_sync # noqa: F401
693
694 return bool(can_run_sync())
695 except ImportError:
696 return False
697
698
699def _is_node_js() -> bool:

Callers 3

should_return_falseFunction · 0.90
send_streaming_requestFunction · 0.85
send_requestFunction · 0.85

Calls

no outgoing calls

Tested by 1

should_return_falseFunction · 0.72