fixes for python 2.1
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8877 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8086b62374
commit
31b6e161eb
9 changed files with 27 additions and 12 deletions
|
|
@ -4,7 +4,7 @@ from callback import *
|
||||||
if foo(2) != 2:
|
if foo(2) != 2:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if A.bar(2) != 4:
|
if A_bar(2) != 4:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if foobar(3, _callback.foo) != foo(3):
|
if foobar(3, _callback.foo) != foo(3):
|
||||||
|
|
@ -13,7 +13,7 @@ if foobar(3, _callback.foo) != foo(3):
|
||||||
if foobar(3, foo) != foo(3):
|
if foobar(3, foo) != foo(3):
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if foobar(3, A.bar) != A.bar(3):
|
if foobar(3, A_bar) != A_bar(3):
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if foobar(3, foof) != foof(3):
|
if foobar(3, foof) != foof(3):
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import default_args
|
import default_args
|
||||||
|
|
||||||
|
|
||||||
if default_args.Statics.staticMethod() != 60:
|
if default_args.Statics_staticMethod() != 60:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if default_args.cfunc1(1) != 2:
|
if default_args.cfunc1(1) != 2:
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class MyExample3(director_abstract.Example3_i):
|
||||||
return b
|
return b
|
||||||
|
|
||||||
me1 = MyExample1()
|
me1 = MyExample1()
|
||||||
if MyExample1.get_color(me1, 1,2,3) != 1:
|
if MyExample1_get_color(me1, 1,2,3) != 1:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
me2 = MyExample2(1,2)
|
me2 = MyExample2(1,2)
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class C(FooBar_int):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
cc = C()
|
cc = C()
|
||||||
c = C.get_self(cc)
|
c = FooBar_int_get_self(cc)
|
||||||
c.advance()
|
c.advance()
|
||||||
|
|
||||||
if c.get_name() != "FooBar::get_name hello":
|
if c.get_name() != "FooBar::get_name hello":
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,13 @@ f = Foo(b=2,a=1)
|
||||||
if f.foo(b=1,a=2) != 3:
|
if f.foo(b=1,a=2) != 3:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if Foo.statfoo(b=2) != 3:
|
if Foo_statfoo(b=2) != 3:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if f.efoo(b=2) != 3:
|
if f.efoo(b=2) != 3:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if Foo.sfoo(b=2) != 3:
|
if Foo_sfoo(b=2) != 3:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,13 +30,13 @@ b = BarInt(b=2,a=1)
|
||||||
if b.bar(b=1,a=2) != 3:
|
if b.bar(b=1,a=2) != 3:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if BarInt.statbar(b=2) != 3:
|
if BarInt_statbar(b=2) != 3:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if b.ebar(b=2) != 3:
|
if b.ebar(b=2) != 3:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
if BarInt.sbar(b=2) != 3:
|
if BarInt_sbar(b=2) != 3:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ r = circle.radius()
|
||||||
if (r != 1.5):
|
if (r != 1.5):
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
point = Geometry.create(Geometry.POINT)
|
point = Geometry_create(Geometry.POINT)
|
||||||
w = point.width()
|
w = point.width()
|
||||||
if (w != 1.0):
|
if (w != 1.0):
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,6 @@ if (nsoverload() != 1050):
|
||||||
raise RuntimeError, ("nsoverload(const char *)")
|
raise RuntimeError, ("nsoverload(const char *)")
|
||||||
|
|
||||||
|
|
||||||
A.foo(1)
|
A_foo(1)
|
||||||
b = B()
|
b = B()
|
||||||
b.foo(1)
|
b.foo(1)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
from template_static import *
|
from template_static import *
|
||||||
|
|
||||||
Foo.bar_double(1)
|
Foo_bar_double(1)
|
||||||
|
|
|
||||||
|
|
@ -1134,6 +1134,14 @@ SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
|
||||||
Py_DECREF(dict);
|
Py_DECREF(dict);
|
||||||
}
|
}
|
||||||
return inst;
|
return inst;
|
||||||
|
#else
|
||||||
|
#if (PY_VERSION_HEX >= 0x02010000)
|
||||||
|
PyObject *inst;
|
||||||
|
PyObject *dict = PyDict_New();
|
||||||
|
PyDict_SetItem(dict, SWIG_This(), swig_this);
|
||||||
|
inst = PyInstance_NewRaw(data->newargs, dict);
|
||||||
|
Py_DECREF(dict);
|
||||||
|
return (PyObject *) inst;
|
||||||
#else
|
#else
|
||||||
PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
|
PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
|
||||||
if (inst == NULL) {
|
if (inst == NULL) {
|
||||||
|
|
@ -1146,9 +1154,16 @@ SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
|
||||||
Py_DECREF(inst);
|
Py_DECREF(inst);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#ifdef Py_TPFLAGS_HAVE_WEAKREFS
|
||||||
|
inst->in_weakreflist = NULL;
|
||||||
|
#endif
|
||||||
|
#ifdef Py_TPFLAGS_GC
|
||||||
|
PyObject_GC_Init(inst);
|
||||||
|
#endif
|
||||||
PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
|
PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
|
||||||
return (PyObject *) inst;
|
return (PyObject *) inst;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a new pointer object */
|
/* Create a new pointer object */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue