[C++-sig] Py++ Error for function operator *()

Roman Yakovenko roman.yakovenko at gmail.com
Sat Jun 9 18:59:06 CEST 2007


On 6/7/07, Haridev, Meghana <mharidev at qualcomm.com> wrote:
> Hi Roman,

Hi, sorry for late response I was on vacation. I will try to
understand what is going on and will let you know when fix is
available.

I hope I will have it in next few days.

> We've been using Py++ 0.8.5 for a while now and it has been working
> great. I'm in the process of upgrading to Py++ 0.9.0.
>
> I currently have the following installed:
> 1. Gccxml (cvs-snapshot June 5, 2007): There is some problem with the
> extraction of the tarball at
> https://sourceforge.net/project/showfiles.php?group_id=118209&package_id
> =146545, so I'm just using the latest from cvs. And I am positive that
> this is not the source of the problem I'm running into.
> 2. Pygccxml (0.9.0)
> 3. Py++ (0.9.0)
>
> -----------------------------------------------------------------------
> When I moved from Py++ 0.8.5 to Py++ 0.9.0, Py++ fails for the following
> function declaration during the module_builder's build_code_creator()
> phase:
>
> operator * (const ACE_Time_Value &tv, double d)
> {
>    //.....
> }
>
> Here's the Error message:
>
>     self.moduleBuilder.build_code_creator(self.moduleName,
> create_casting_constructor=flag_casting_constr)
>   File
> "/opt/data/BTBLD_rhine_1080/thirdParty/lib/python2.4/site-packages/pyplu
> splus/module_builder/builder.py", line 247, in build_code_creator
>     self.__code_creator = creator.create()
>   File
> "/opt/or-tree/mharidev/thirdParty/lib/python2.4/site-packages/pyplusplus
> /module_creator/creator.py", line 315, in create
>     self._adopt_free_operator( operator )
>   File
> "/opt/or-tree/mharidev/thirdParty/lib/python2.4/site-packages/pyplusplus
> /module_creator/creator.py", line 185, in _adopt_free_operator
>     assert isinstance( arg_type, declarations.declarated_t )
> AssertionError
>
> -----------------------------------------------------------------------
> I narrowed down the Error to this part of the code (Py++ 0.9.0) in
> function _adopt_free_operator() of
> pyplusplus/module_creator/creator.py(line 178):
>
> arg_type = declarations.base_type( operator.arguments[0].type )
> if isinstance( arg_type, declarations.fundamental_t ):
>      arg_type = declarations.base_type( operator.arguments[1].type )
> elif isinstance( arg_type, declarations.declarated_t ) and
>
>                  arg_type.declaration.ignore:
>     arg_type = declarations.base_type( operator.arguments[1].type )
> else:
>     pass
> assert isinstance( arg_type, declarations.declarated_t )
>
> -----------------------------------------------------------------------
>
> Note that I don't have this problem with the earlier version (Py++
> 0.8.5) when the code looked like this and didn't have the extra check:
>
> arg_type = declarations.base_type( operator.arguments[0].type )
> if isinstance( arg_type, declarations.fundamental_t ):
>      arg_type = declarations.base_type( operator.arguments[1].type )
> assert isinstance( arg_type, declarations.declarated_t )
>
> -----------------------------------------------------------------------
>
> Any ideas to how this can be fixed?
>
> Thanks for your help,
> -Meghana.
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>


-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list