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:
parent
39a75442a1
commit
76bcec1d87
18 changed files with 118 additions and 41 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue