I was able to get swig-3.0.7 to stop complaining when I removed the spaces.
diff --git a/source/API/Leap.i b/source/API/Leap.i
index ed5c04c..cff8648 100644
--- a/source/API/Leap.i
+++ b/source/API/Leap.i
@@ -538,8 +538,7 @@ SWIG_CSBODY_PROXY(public, public, SWIGTYPE)
__swig_getmethods__["data"] = data
if _newclass:data = _swig_property(data)
__swig_getmethods__["distortion"] = distortion
- if _newclass:distortion = _swig_property(distortion)
-%}}
+ if _newclass:distortion = _swig_property(distortion)%}}
%extend Leap::Mask {
%pythoncode {
@@ -548,8 +547,7 @@ SWIG_CSBODY_PROXY(public, public, SWIGTYPE)
LeapPython.Mask_data(self, ptr)
return ptr
__swig_getmethods__["data"] = data
- if _newclass:data = _swig_property(data)
-%}}
+ if _newclass:data = _swig_property(data)%}}
%extend Leap::Frame {
%pythoncode {
@@ -561,8 +559,7 @@ SWIG_CSBODY_PROXY(public, public, SWIGTYPE)
def deserialize(self, tup):
LeapPython.Frame_deserialize(self, tup[0], tup[1])
__swig_getmethods__["serialize"] = serialize
- if _newclass:serialize = _swig_property(serialize)
-%}}
+ if _newclass:serialize = _swig_property(serialize)%}}
%constattrib( Leap::Image, void*, dataPointer );
%constattrib( Leap::Image, void*, distortionPointer );
@@ -987,8 +984,7 @@ extern "C" BOOL WINAPI DllMain(
%extend Leap::Vector {
%pythoncode {
def to_float_array(self): return [self.x, self.y, self.z]
- def to_tuple(self): return (self.x, self.y, self.z)
-%}}
+ def to_tuple(self): return (self.x, self.y, self.z)%}}
%extend Leap::Matrix {
%pythoncode {
def to_array_3x3(self, output = None):
@@ -1005,8 +1001,7 @@ extern "C" BOOL WINAPI DllMain(
output[4], output[5], output[6], output[7] = self.y_basis.x, self.y_basis.y, self.y_basis.z, 0.0
output[8], output[9], output[10], output[11] = self.z_basis.x, self.z_basis.y, self.z_basis.z, 0.0
output[12], output[13], output[14], output[15] = self.origin.x, self.origin.y, self.origin.z, 1.0
- return output
-%}}
+ return output%}}
#endif
@@ -1093,8 +1088,7 @@ extern "C" BOOL WINAPI DllMain(
_pos = 0
while _pos < len(self):
yield self[_pos]
- _pos += 1
-%}}
+ _pos += 1%}}
%enddef
#else
@@ -1152,8 +1146,7 @@ extern "C" BOOL WINAPI DllMain(
return LeapPython.Config_set_float(self, *args)
elif type == LeapPython.Config_TYPE_STRING:
return LeapPython.Config_set_string(self, *args)
- return False
-%}}
+ return False%}}
// Ignore methods that are unnecessary due to get and set functions defined above
%feature("shadow") Leap::Config::type(const std::string& key) const %{%}
%feature("shadow") Leap::Config::getBool(const std::string& key) const %{%}
Putting %}} at the end of those lines seems odd and ugly though. In case the SWIG behavior changes back in 3.0.8, it may be too soon to consider changing Leap.i in our official release.