From: Jakob S. <pj...@ip...> - 2001-12-12 10:24:37
|
Hi Scott, thanks very much for your response, your question pointed out my mistake. I had first called eval() and then exec() relying (I am using BSF) on the raising of an exception in eval() to trigger the call to exec(). If any excepton is raised in eval() it believes it is an expression and calls exec(). But, what is it that triggers the Python exception, is it the return of null from __findattr__()? Can I prevent the exception to be raised (I want my own error message)? Thanks, Jakob -----Original Message----- From: Scott Schenkein [mailto:sch...@ya...] Sent: 11 December 2001 19:14 To: Jakob Svensson; Jyt...@li... Subject: Re: [Jython-users] __findattr__ called twice !? Hello Jakob, Can you please send the list the procedural portion of the code that triggers this "findattr"? Thanks, Scott --- Jakob Svensson <pj...@ip...> wrote: > Hi, > > why is __findattr__() called twice when using the > following java class: > > > import org.python.core.*; > import javax.swing.JOptionPane; > > > public class Test extends PyObject { > > public PyObject __findattr__(String s) { > JOptionPane.showMessageDialog(null,s); > return null; > } > } > > > > And also, can one prevent the Jython error message > if the attribute is not > found? > > > Regards, > Jakob > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > > > __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com |