Convert python tests using 2to3

These tests were converted using 2to3 and should be valid using
Python 2.7 and Python 3+.
This commit is contained in:
William S Fulton 2020-08-15 00:16:04 +01:00
commit d4ffa46f41
66 changed files with 551 additions and 551 deletions

View file

@ -23,20 +23,20 @@ bv[2] = bool(4)
bv[3] = bool(0)
if bv[0] != bv[2]:
raise RuntimeError, "bad std::vector<bool> mapping"
raise RuntimeError("bad std::vector<bool> mapping")
b = B(5)
va = VecA([b, None, b, b])
if va[0].f(1) != 6:
raise RuntimeError, "bad std::vector<A*> mapping"
raise RuntimeError("bad std::vector<A*> mapping")
if vecAptr(va) != 6:
raise RuntimeError, "bad std::vector<A*> mapping"
raise RuntimeError("bad std::vector<A*> mapping")
b.val = 7
if va[3].f(1) != 8:
raise RuntimeError, "bad std::vector<A*> mapping"
raise RuntimeError("bad std::vector<A*> mapping")
ip = PtrInt()
@ -47,7 +47,7 @@ ArrInt_setitem(ap, 2, 123)
vi = IntPtrVector((ip, ap, None))
if ArrInt_getitem(vi[0], 0) != ArrInt_getitem(vi[1], 2):
raise RuntimeError, "bad std::vector<int*> mapping"
raise RuntimeError("bad std::vector<int*> mapping")
delete_ArrInt(ap)
@ -57,42 +57,42 @@ a = halfs([10, 8, 4, 3])
v = IntVector()
v[0:2] = [1, 2]
if v[0] != 1 or v[1] != 2:
raise RuntimeError, "bad setslice"
raise RuntimeError("bad setslice")
if v[0:-1][0] != 1:
raise RuntimeError, "bad getslice"
raise RuntimeError("bad getslice")
if v[0:-2].size() != 0:
raise RuntimeError, "bad getslice"
raise RuntimeError("bad getslice")
v[0:1] = [2]
if v[0] != 2:
raise RuntimeError, "bad setslice"
raise RuntimeError("bad setslice")
v[1:] = [3]
if v[1] != 3:
raise RuntimeError, "bad setslice"
raise RuntimeError("bad setslice")
v[2:] = [3]
if v[2] != 3:
raise RuntimeError, "bad setslice"
raise RuntimeError("bad setslice")
if v[0:][0] != v[0]:
raise RuntimeError, "bad getslice"
raise RuntimeError("bad getslice")
del v[:]
if v.size() != 0:
raise RuntimeError, "bad getslice"
raise RuntimeError("bad getslice")
del v[:]
if v.size() != 0:
raise RuntimeError, "bad getslice"
raise RuntimeError("bad getslice")
v = vecStr(["hello ", "world"])
if v[0] != "hello world":
raise RuntimeError, "bad std::string+std::vector"
raise RuntimeError("bad std::string+std::vector")
pv = pyvector([1, "hello", (1, 2)])