Update python_pybuffer_runme.py syntax for working under both python 2 and 3
This commit is contained in:
parent
4d5f4bcd33
commit
b456449940
1 changed files with 8 additions and 8 deletions
|
|
@ -47,24 +47,24 @@ else:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
python_pybuffer.func1(1)
|
python_pybuffer.func1(1)
|
||||||
raise RuntimeError, "should throw TypeError"
|
raise RuntimeError("should throw TypeError")
|
||||||
except TypeError, e:
|
except TypeError as e:
|
||||||
check("(char *buf1, int len)" in str(e))
|
check("(char *buf1, int len)" in str(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
python_pybuffer.func2(1)
|
python_pybuffer.func2(1)
|
||||||
raise RuntimeError, "should throw TypeError"
|
raise RuntimeError("should throw TypeError")
|
||||||
except TypeError, e:
|
except TypeError as e:
|
||||||
check("(char *buf2)" in str(e))
|
check("(char *buf2)" in str(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
python_pybuffer.func3(1)
|
python_pybuffer.func3(1)
|
||||||
raise RuntimeError, "should throw TypeError"
|
raise RuntimeError("should throw TypeError")
|
||||||
except TypeError, e:
|
except TypeError as e:
|
||||||
check("(const char *buf3, int len)" in str(e))
|
check("(const char *buf3, int len)" in str(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
python_pybuffer.func4(1)
|
python_pybuffer.func4(1)
|
||||||
raise RuntimeError, "should throw TypeError"
|
raise RuntimeError("should throw TypeError")
|
||||||
except TypeError, e:
|
except TypeError as e:
|
||||||
check("(const char *buf4)" in str(e))
|
check("(const char *buf4)" in str(e))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue