Skip to content

Commit 028b498

Browse files
committed
Address review
1 parent 2becd71 commit 028b498

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

Doc/library/sys.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,9 +1189,10 @@ always available. Unless explicitly noted otherwise, all variables are read-only
11891189
this implementation supports multiple isolated interpreters.
11901190
It is ``True`` for CPython on most platforms. Platforms with
11911191
this support implement the low-level :mod:`!_interpreters` module.
1192-
1193-
.. seealso:
1194-
:pep:`684`, :pep:`734`, and :mod:`concurrent.interpreters`.
1192+
1193+
.. seealso::
1194+
1195+
:pep:`684`, :pep:`734`, and :mod:`concurrent.interpreters`.
11951196

11961197
:data:`sys.implementation` may contain additional attributes specific to
11971198
the Python implementation. These non-standard attributes must start with

Lib/test/test_sys.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,9 +1089,17 @@ def test_implementation(self):
10891089
sys.implementation.name.lower())
10901090

10911091
# https://peps.python.org/pep-0734
1092-
self.assertIsInstance(sys.implementation.supports_isolated_interpreters, bool)
1092+
sii = sys.implementation.supports_isolated_interpreters
1093+
self.assertIsInstance(sii, bool)
10931094
if test.support.check_impl_detail(cpython=True):
1094-
self.assertIs(sys.implementation.supports_isolated_interpreters, True)
1095+
if (
1096+
test.support.is_apple_mobile
1097+
or test.support.is_emscripten
1098+
or test.support.is_wasi
1099+
):
1100+
self.assertFalse(sii)
1101+
else:
1102+
self.assertTrue(sii)
10951103

10961104
@test.support.cpython_only
10971105
def test_debugmallocstats(self):

Python/sysmodule.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3602,8 +3602,17 @@ make_impl_info(PyObject *version_info)
36023602
goto error;
36033603
#endif
36043604

3605-
res = PyDict_SetItemString(impl_info, "supports_isolated_interpreters",
3606-
Py_NewRef(Py_True)); // PEP-734
3605+
// PEP-734
3606+
#if defined(__wasi__) || defined(__EMSCRIPTEN__)
3607+
// It is not enabled on WASM builds just yet
3608+
value = Py_NewRef(Py_False);
3609+
#elif defined(__APPLE__) && defined(TARGET_OS_IPHONE)
3610+
// It is not enabled on iOS just yet
3611+
value = Py_NewRef(Py_False);
3612+
#else
3613+
value = Py_NewRef(Py_True);
3614+
#endif
3615+
res = PyDict_SetItemString(impl_info, "supports_isolated_interpreters", value);
36073616
if (res < 0) {
36083617
goto error;
36093618
}

0 commit comments

Comments
 (0)