You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
tests/basics: Convert "sys.exit()" to "raise SystemExit".
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
try:
|
||||
import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
a = array.array('B', [1, 2, 3])
|
||||
print(a, len(a))
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
try:
|
||||
import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
a1 = array.array('I', [1])
|
||||
a2 = array.array('I', [2])
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
try:
|
||||
from array import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
# tuple, list
|
||||
print(array('b', (1, 2)))
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
try:
|
||||
from array import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
# construct from something with unknown length (requires generators)
|
||||
print(array('i', (i for i in range(10))))
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
try:
|
||||
from array import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
# raw copy from bytes, bytearray
|
||||
print(array('h', b'12'))
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
try:
|
||||
from array import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
print(array('L', [0, 2**32-1]))
|
||||
print(array('l', [-2**31, 0, 2**31-1]))
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
try:
|
||||
import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
# arrays of objects
|
||||
a = array.array('O')
|
||||
|
||||
@@ -8,9 +8,8 @@ t = sys.implementation
|
||||
try:
|
||||
t.name
|
||||
except AttributeError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
|
||||
# test printing of attrtuple
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
try:
|
||||
delattr
|
||||
except:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
class A: pass
|
||||
a = A()
|
||||
|
||||
@@ -4,8 +4,7 @@ try:
|
||||
help
|
||||
except NameError:
|
||||
print("SKIP")
|
||||
import sys
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
help() # no args
|
||||
help(help) # help for a function
|
||||
|
||||
@@ -3,9 +3,8 @@ try:
|
||||
min
|
||||
max
|
||||
except:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
print(min(0,1))
|
||||
print(min(1,0))
|
||||
|
||||
@@ -6,9 +6,8 @@ import builtins
|
||||
try:
|
||||
builtins.abs = lambda x: x + 1
|
||||
except AttributeError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
print(abs(1))
|
||||
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
try:
|
||||
print(pow(3, 4, 7))
|
||||
except NotImplementedError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
# 3 arg pow is defined to only work on integers
|
||||
try:
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
try:
|
||||
print(pow(3, 4, 7))
|
||||
except NotImplementedError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
print(pow(555557, 1000002, 1000003))
|
||||
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
try:
|
||||
property
|
||||
except:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
# create a property object explicitly
|
||||
property()
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
try:
|
||||
range(0).start
|
||||
except AttributeError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
# attrs
|
||||
print(range(1, 2, 3).start)
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
try:
|
||||
reversed
|
||||
except:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
# list
|
||||
print(list(reversed([])))
|
||||
|
||||
@@ -3,9 +3,8 @@ try:
|
||||
sorted
|
||||
set
|
||||
except:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
print(sorted(set(range(100))))
|
||||
print(sorted(set(range(100)), key=lambda x: x + 100*(x % 2)))
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
try:
|
||||
from array import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
# arrays
|
||||
print(bytearray(array('b', [1, 2])))
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
try:
|
||||
from array import array
|
||||
except ImportError:
|
||||
import sys
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
raise SystemExit
|
||||
|
||||
# arrays
|
||||
print(bytearray(array('h', [1, 2])))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user