Commit a2803b74 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

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

parent 0161939e
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)))
......
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])))
......
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