Use %{ %} instead of { } after %pythoncode
Simpler and safer change to address PR#357.
This commit is contained in:
parent
3bc5348bd2
commit
c8a7322a4d
6 changed files with 23 additions and 23 deletions
|
|
@ -176,7 +176,7 @@ SwigPython_std_pair_setitem (PyObject *a, Py_ssize_t b, PyObject *c)
|
|||
%define %swig_pair_methods(pair...)
|
||||
#if !defined(SWIGPYTHON_BUILTIN)
|
||||
%extend {
|
||||
%pythoncode {def __len__(self):
|
||||
%pythoncode %{def __len__(self):
|
||||
return 2
|
||||
def __repr__(self):
|
||||
return str((self.first, self.second))
|
||||
|
|
@ -189,7 +189,7 @@ def __setitem__(self, index, val):
|
|||
if not (index % 2):
|
||||
self.first = val
|
||||
else:
|
||||
self.second = val}
|
||||
self.second = val%}
|
||||
}
|
||||
#endif
|
||||
%enddef
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue