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:
Olly Betts 2018-05-19 11:47:23 +12:00 committed by William S Fulton
commit 728b8955bd
20 changed files with 96 additions and 241 deletions

View file

@ -1,9 +1,5 @@
from namespace_class import *
def is_new_style_class(cls):
return hasattr(cls, "__class__")
try:
p = Private1()
error = 1
@ -22,10 +18,7 @@ except:
if (error):
raise RuntimeError, "Private2 is private"
if is_new_style_class(EulerT3D):
EulerT3D.toFrame(1, 1, 1)
else:
EulerT3D().toFrame(1, 1, 1)
EulerT3D.toFrame(1, 1, 1)
b = BooT_i()
b = BooT_H()
@ -40,7 +33,6 @@ f.moo(1)
f = FooT_H()
f.foo(Hi)
if is_new_style_class(FooT_H):
f_type = str(type(f))
if f_type.find("'namespace_class.FooT_H'") == -1:
raise RuntimeError("Incorrect type: " + f_type)
f_type = str(type(f))
if f_type.find("'namespace_class.FooT_H'") == -1:
raise RuntimeError("Incorrect type: " + f_type)