Commit 85d809d1 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests: Convert remaining "sys.exit()" to "raise SystemExit".

parent a2803b74
......@@ -4,8 +4,7 @@ try:
import uerrno
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
#f = open("_test.db", "w+b")
f = uio.BytesIO()
......
......@@ -2,8 +2,7 @@ try:
import framebuf
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
w = 5
h = 16
......
......@@ -2,8 +2,7 @@ try:
import framebuf
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
def printbuf():
print("--8<--")
......
......@@ -2,8 +2,7 @@ try:
import framebuf
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
def printbuf():
print("--8<--")
......
......@@ -8,8 +8,7 @@ try:
machine.mem8
except:
print("SKIP")
import sys
sys.exit()
raise SystemExit
print(machine.mem8)
......
......@@ -6,8 +6,7 @@ try:
machine.PinBase
except AttributeError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
class MyPin(machine.PinBase):
......
......@@ -7,8 +7,7 @@ try:
machine.time_pulse_us
except AttributeError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
class ConstPin(machine.PinBase):
......
......@@ -9,8 +9,7 @@ try:
machine.Signal
except AttributeError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
class Pin(machine.PinBase):
def __init__(self):
......
import sys
import utime
try:
utime.sleep_ms
except AttributeError:
print("SKIP")
sys.exit()
raise SystemExit
utime.sleep_ms(1)
utime.sleep_us(1)
......
......@@ -4,9 +4,8 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(binascii.a2b_base64(b''))
print(binascii.a2b_base64(b'Zg=='))
......
......@@ -4,9 +4,8 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(binascii.b2a_base64(b''))
print(binascii.b2a_base64(b'f'))
......
......@@ -4,16 +4,14 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
try:
binascii.crc32
except AttributeError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
print(hex(binascii.crc32(b'The quick brown fox jumps over the lazy dog')))
print(hex(binascii.crc32(b'\x00' * 32)))
......
......@@ -4,9 +4,8 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(binascii.hexlify(b'\x00\x01\x02\x03\x04\x05\x06\x07'))
print(binascii.hexlify(b'\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f'))
......
......@@ -4,9 +4,8 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# two arguments supported in uPy but not CPython
a = binascii.hexlify(b'123', ':')
......
......@@ -4,9 +4,8 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(binascii.unhexlify(b'0001020304050607'))
print(binascii.unhexlify(b'08090a0b0c0d0e0f'))
......
......@@ -3,9 +3,8 @@
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
buf = b"12345678abcd"
struct = uctypes.struct(
......
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
desc = {
# arr is array at offset 0, of UINT8 elements, array size is 2
......
......@@ -3,11 +3,11 @@ try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
if sys.byteorder != "little":
print("SKIP")
sys.exit()
raise SystemExit
desc = {
# arr is array at offset 0, of UINT8 elements, array size is 2
......
......@@ -3,11 +3,11 @@ try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
if sys.byteorder != "little":
print("SKIP")
sys.exit()
raise SystemExit
desc = {
# arr is array at offset 0, of UINT8 elements, array size is 2
......
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
desc = {
"arr": (uctypes.ARRAY | 0, uctypes.UINT8 | 2),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment