Fix python tests for old versions of Python

This commit is contained in:
William S Fulton 2015-01-31 17:38:06 +00:00
commit f1213809a2
6 changed files with 29 additions and 14 deletions

View file

@ -35,12 +35,18 @@ me1 = MyExample1()
if director_abstract.Example1_get_color(me1, 1,2,3) != 1:
raise RuntimeError
MyExample2_static = MyExample2 if is_new_style_class(MyExample2) else MyExample2(0, 0)
if is_new_style_class(MyExample2):
MyExample2_static = MyExample2
else:
MyExample2_static = MyExample2(0, 0)
me2 = MyExample2(1,2)
if MyExample2_static.get_color(me2, 1,2,3) != 2:
raise RuntimeError
MyExample3_static = MyExample3 if is_new_style_class(MyExample3) else MyExample3()
if is_new_style_class(MyExample3):
MyExample3_static = MyExample3
else:
MyExample3_static = MyExample3()
me3 = MyExample3()
if MyExample3_static.get_color(me3, 1,2,3) != 3:
raise RuntimeError