summaryrefslogtreecommitdiff
path: root/tests/basics/sys1.py
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2023-12-04 15:54:59 +0100
committerDamien George <damien@micropython.org>2023-12-15 11:43:39 +1100
commit85c02166cacb8c2a8bc82f9802814ca72cbf6017 (patch)
treeef19d9ed8905a2c03867182747944f99e314dff3 /tests/basics/sys1.py
parent05d3b223011a88a10c806be866db8e0d29f1e348 (diff)
py/modsys: Implement optional sys.intern.
Signed-off-by: stijn <stijn@ignitron.net>
Diffstat (limited to 'tests/basics/sys1.py')
-rw-r--r--tests/basics/sys1.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/basics/sys1.py b/tests/basics/sys1.py
index 759b9a6ea..95d8905d1 100644
--- a/tests/basics/sys1.py
+++ b/tests/basics/sys1.py
@@ -23,3 +23,18 @@ if hasattr(sys.implementation, '_mpy'):
else:
# Effectively skip subtests
print(int)
+
+try:
+ print(sys.intern('micropython') == 'micropython')
+ has_intern = True
+except AttributeError:
+ has_intern = False
+ print(True)
+
+if has_intern:
+ try:
+ print(sys.intern(0))
+ except TypeError:
+ print(True)
+else:
+ print(True)