summaryrefslogtreecommitdiff
path: root/tests/basics/sys1.py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-07-15 13:32:55 +1000
committerDamien George <damien@micropython.org>2025-07-22 23:22:05 +1000
commit18f2e94846111ad05d49e260c59de366f3ae2489 (patch)
treeb3b51bb27958694ab3f97015bf059119ef54bed1 /tests/basics/sys1.py
parente993f53877027bc46b226d026845e523c2cc94ca (diff)
py/modsys: Add sys.implementation._thread attribute.
This is useful to distinguish between GIL and non-GIL builds. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/basics/sys1.py')
-rw-r--r--tests/basics/sys1.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/basics/sys1.py b/tests/basics/sys1.py
index 94220fe4a..31081e423 100644
--- a/tests/basics/sys1.py
+++ b/tests/basics/sys1.py
@@ -30,6 +30,12 @@ else:
# Effectively skip subtests
print(str)
+if hasattr(sys.implementation, '_thread'):
+ print(sys.implementation._thread in ("GIL", "unsafe"))
+else:
+ # Effectively skip subtests
+ print(True)
+
try:
print(sys.intern('micropython') == 'micropython')
has_intern = True