Drop support for Python classic classes
There were only needed to support Python < 2.2, and we now require at least Python 2.6. Conflicts: .travis.yml Examples/test-suite/python/autodoc_runme.py Source/Modules/python.cxx This is a cherry-pick and merge from patch in #1261
This commit is contained in:
parent
dcbccc6f6f
commit
728b8955bd
20 changed files with 96 additions and 241 deletions
|
|
@ -2,17 +2,9 @@
|
|||
from cpp_static import *
|
||||
|
||||
|
||||
def is_new_style_class(cls):
|
||||
return hasattr(cls, "__class__")
|
||||
|
||||
if is_new_style_class(StaticFunctionTest):
|
||||
StaticFunctionTest.static_func()
|
||||
StaticFunctionTest.static_func_2(1)
|
||||
StaticFunctionTest.static_func_3(1, 2)
|
||||
else:
|
||||
StaticFunctionTest().static_func()
|
||||
StaticFunctionTest().static_func_2(1)
|
||||
StaticFunctionTest().static_func_3(1, 2)
|
||||
StaticFunctionTest.static_func()
|
||||
StaticFunctionTest.static_func_2(1)
|
||||
StaticFunctionTest.static_func_3(1, 2)
|
||||
|
||||
if is_python_builtin():
|
||||
if not StaticMemberTest.static_int == 99: raise RuntimeError("static_int not 99")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue