Update python_pybuffer_runme.py syntax for working under both python 2 and 3

This commit is contained in:
William S Fulton 2020-10-07 22:41:04 +01:00
commit b456449940

View file

@ -47,24 +47,24 @@ else:
try:
python_pybuffer.func1(1)
raise RuntimeError, "should throw TypeError"
except TypeError, e:
raise RuntimeError("should throw TypeError")
except TypeError as e:
check("(char *buf1, int len)" in str(e))
try:
python_pybuffer.func2(1)
raise RuntimeError, "should throw TypeError"
except TypeError, e:
raise RuntimeError("should throw TypeError")
except TypeError as e:
check("(char *buf2)" in str(e))
try:
python_pybuffer.func3(1)
raise RuntimeError, "should throw TypeError"
except TypeError, e:
raise RuntimeError("should throw TypeError")
except TypeError as e:
check("(const char *buf3, int len)" in str(e))
try:
python_pybuffer.func4(1)
raise RuntimeError, "should throw TypeError"
except TypeError, e:
raise RuntimeError("should throw TypeError")
except TypeError as e:
check("(const char *buf4)" in str(e))