What the heck has happened to PythonWin???

Mark Hammond mhammond at skippinet.com.au
Thu Oct 31 18:33:03 EST 2002


Thomas Weholt wrote:
> When I press F5 a window containing the source-code for the module
> debugger.py pops up, with what I guess is a break-point on the line def
> _doexec(cmd, globals, locals), line no 923. If I switch back to my script
> and press F5 once more the same window ( debugger.py ) takes focus, but my
> script has been run in the background, putting output into the Interactive
> Window as usual. Haven't touched any options, settings or nothing. I'll
> hopefully switch back to using Linux as my development platform one of these
> days, but I'll still do alot of coding using PythonWin on windows. It would
> be great if it worked like before. Any hint, tip or clue you could give me
> would be highly appreciated.

I'm pretty sure this was due to Python 2.2 correcting a problem in an 
earlier version of the debugger.  This patch seems to work fine for me:

Index: debugger.py
===================================================================
RCS file: /home/cvsroot/PyWin32/Pythonwin/pywin/debugger/debugger.py,v
retrieving revision 1.9
diff -r1.9 debugger.py
582c582,585
<                                       _doexec(cmd, globals, locals)
---
 >                                       if sys.version_info > (2,2):
 >                                               exec cmd in globals, locals
 >                                       else:
 >                                               _doexec(cmd, globals, 
locals)
924c927
<       exec cmd in globals, locals
\ No newline at end of file
---
 >       exec cmd in globals, locals

Unfortunately, this file in indented using tabs, so apply carefully.  A 
simpler hack would be to simply change that:

                                    _doexec(cmd, globals, locals)
to
                                    exec cmd in globals, locals

Mark.




More information about the Python-list mailing list