Douglas Roark
2015-01-28 05:55:18 UTC
Hello. I think I've found a regression bug in the latest version of
SWIG. I'm running it on some code on OS X. I get the following error
when I try to run my program.
---
File "CppBlockUtils.py", line 4075, in <lambda>
__setattr__ = lambda self, name, value: _swig_setattr(self,
BDM_CallBack, name, value)
File "CppBlockUtils.py", line 51, in _swig_setattr
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
File "CppBlockUtils.py", line 45, in _swig_setattr_nondynamic
object.__setattr__(self, name, value)
---
It looks like there's some sort of regression bug in 3.0.4, or
possibly 3.0.3. (I'm using brew to run pre-compiled SWIG binaries.
3.0.3 isn't available.) The _swig_setattr_nondynamic() call is
different. Here's what I'm seeing.
---3.0.2---
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
---3.0.4---
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name, None)
if method:
return method(self, value)
if (not static):
object.__setattr__(self, name, value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
Any thoughts on why the code went from "self.__dict[name] = value" to
"object.__setattr__(self, name, value)"? Is this a genuine bug? Am I
missing something?
Thanks.
Doug
SWIG. I'm running it on some code on OS X. I get the following error
when I try to run my program.
---
File "CppBlockUtils.py", line 4075, in <lambda>
__setattr__ = lambda self, name, value: _swig_setattr(self,
BDM_CallBack, name, value)
File "CppBlockUtils.py", line 51, in _swig_setattr
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
File "CppBlockUtils.py", line 45, in _swig_setattr_nondynamic
object.__setattr__(self, name, value)
---
It looks like there's some sort of regression bug in 3.0.4, or
possibly 3.0.3. (I'm using brew to run pre-compiled SWIG binaries.
3.0.3 isn't available.) The _swig_setattr_nondynamic() call is
different. Here's what I'm seeing.
---3.0.2---
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
---3.0.4---
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name, None)
if method:
return method(self, value)
if (not static):
object.__setattr__(self, name, value)
else:
raise AttributeError("You cannot add attributes to %s" % self)
Any thoughts on why the code went from "self.__dict[name] = value" to
"object.__setattr__(self, name, value)"? Is this a genuine bug? Am I
missing something?
Thanks.
Doug