[C++-sig] Pyste 1.31.0 and exceptions

Nicodemus nicodemus at esss.com.br
Tue Mar 9 02:08:23 CET 2004


Dan Halbert wrote:

>  >From: "Niall Douglas" <s_sourceforge at nedprod.com>
>  >On 8 Mar 2004 at 12:12, Dan Halbert wrote:
>  >
>  >> foo = AllFromHeader("foo.h")
>  >
>  >Last time I heard AllFromHeader() was still not working.
>
>Actually, it seems to work pretty well for me, though I promise to be
>careful. But even if I change my example to what is below, and don't
>use AllFromHeader(), I get the same error as I listed previously. --Dan
>
>==============================================
>foo.pyste:
>
>##foo = AllFromHeader("foo.h")
>Function("g", "foo.h")
>Class("C", "foo.h")
>==============================================
>foo.h:
>
>void g() throw (int);                       // line #1
>class C { public: void f() throw (int); };  // line #2
>==============================================
>
>  ...
>  File "/d4m/tools/i686ling/Python-2.3.3/lib/python2.3/site-packages/Pyste/declarations.py", line 226, in Exceptions
>    return " throw(%s)" % ', '.join (self.throws)
>TypeError: sequence item 0: expected string, FundamentalType found
>
>

Thanks for reporting this. A patch that fixes this is applied to CVS.
AllFromHeader doesn't work for some classes hierarquies, for simple uses 
it works fine. I still can't find time to make it work... way too busy. 8(

Regards,
Nicodemus.


Index: declarations.py
===================================================================
RCS file: /cvsroot/boost/boost/libs/python/pyste/src/Pyste/declarations.py,v
retrieving revision 1.6
diff -r1.6 declarations.py
226c226
<             return " throw(%s)" % ', '.join (self.throws)
---
 >             return " throw(%s)" % ', '.join ([x.FullName() for x in 
self.throws])
239c239
<             return '(%s (*)(%s))&%s' % (result, params, self.FullName())
---
 >             return '(%s (*)(%s)%s)&%s' % (result, params, 
self.Exceptions(), self.FullName())
349c349
<         is_public = self.visibility = Scope.public
---
 >         is_public = self.visibility == Scope.public






More information about the Cplusplus-sig mailing list