From: Alberto Di M. <Alb...@ce...> - 2006-11-22 22:48:13
|
Hi Armin, thanks for the suggestion. It works fine. And I must say the result is pretty amazing. I had some code that was taking several minutes to complete and with Psyco takes a few seconds. Incredible. For the moment I can probably include a patched copy of traceback.py with my code, but let me know if you manage to push a fix into Psyco. Merci beaucoup! Alberto > -----Original Message----- > From: Armin Rigo [mailto:ar...@tu...] > Sent: Wednesday, 22 November 2006 22:37 > To: Alberto Di Meglio > Cc: psy...@li... > Subject: Re: [Psyco-devel] Psyco and log4py in the same module > > Hi, > > On Wed, Nov 22, 2006 at 02:01:08PM +0100, Alberto Di Meglio wrote: > > is it possible to use psyco and log4py together? If psyco is used, > > log4py has problems. To exemplify, the following pretty dumb code > > produces an exception in log4py: > > Thanks for the note. I didn't notice so far that the > traceback.py module of the standard library uses a strange > old way to access the current frame stack. I need to look > more, but it's possible that there would be a way for Psyco > to support that; in the meantime you can patch traceback.py > to replace the 3 occurrences of code like: > > try: > raise ZeroDivisionError > except ZeroDivisionError: > f = sys.exc_info()[2].tb_frame.f_back > > with: > > f = sys._getframe(1) > > which Psyco (mostly) supports. I also realized that the > frame-related problems seem to be the main reason why pdb > doesn't work with Psyco. I think it should be possible for > me to fix this too... > > > A bientot, > > Armin > |