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,12 +1,18 @@
|
|||
from python_append import *
|
||||
|
||||
def is_new_style_class(cls):
|
||||
return hasattr(cls, "__class__")
|
||||
|
||||
# test not relevant for -builtin
|
||||
if is_python_builtin():
|
||||
exit(0)
|
||||
|
||||
t=Test()
|
||||
t.func()
|
||||
t.static_func()
|
||||
if is_new_style_class(Test):
|
||||
t.static_func()
|
||||
else:
|
||||
Test_static_func()
|
||||
|
||||
if grabpath() != os.path.dirname(mypath):
|
||||
raise RuntimeError("grabpath failed")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue