al...@us... wrote:
> Revision: 451
> Author: allenb
> Date: 2006-08-23 16:30:51 -0700 (Wed, 23 Aug 2006)
> ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=451&view=rev
>
> Log Message:
> -----------
> I *think* this fixes a bug.
>
> As far as I can tell with Python 2.4 atleast bool([False,True]) is still true so the logic of this test was not working.
>
> Please review this commit to verify that I have fixed something though.
>
> Modified Paths:
> --------------
> pygccxml_dev/pygccxml/declarations/mdecl_wrapper.py
> Modified: pygccxml_dev/pygccxml/declarations/mdecl_wrapper.py
> [...]
> invalid_decls = filter( lambda d: not hasattr( d, name ), self.decls )
> - if invalid_decls:
> + if False in invalid_decls:
> raise RuntimeError( "Not all declarations have '%s' attribute." % name )
This doesn't look like a fix to me.... (what had to be fixed here anyway?).
The previous 'if' statement was equivalent to
if len(invalid_decls)!=0:
...
which looked all right to me (note that the previous line uses "filter",
not "map").
The new 'if' statement checks if the list contains the value "False"
which I don't think will ever happen.
- Matthias -
|