Test-suite fixes for python -classic

These are mostly workarounds for static class members not being supported for
old style classes, as documented in Python.html, "C++ classes".
This commit is contained in:
William S Fulton 2015-01-31 15:04:35 +00:00
commit 76bcec1d87
18 changed files with 118 additions and 41 deletions

View file

@ -1,5 +1,8 @@
from smart_pointer_member import *
def is_new_style_class(cls):
return hasattr(cls, "__class__")
f = Foo()
f.y = 1
@ -20,8 +23,9 @@ if b.x != f.x:
if b.z != f.z:
raise RuntimeError
if Foo.z == Bar.z:
raise RuntimeError
if is_new_style_class(Bar): # feature not supported in old style classes
if Foo.z == Bar.z:
raise RuntimeError