sys.settrace() and Python 2.3


J

Josiah Carlson

According to my reading of Python 2.3 docs, the call to goo() at the end
should exit with a KeyboardInterrupt...

import sys

def goo():
while 1:
pass

count = [100]
def foo(frame, event, arg):
count[0] -= 1
if not count[0]:
raise KeyboardInterrupt
return foo

sys.settrace(foo)

goo()

In Python 2.3, the above call to goo() doesn't seem to ever return. It
exits with a KeyboardInterrupt in 2.4, as expected. Does anyone have an
idea why this is the case? I've checked the release notes for both 2.3
and 2.4 and found no discussion of trace functions in them or
sourceforge (I could be entering in the wrong terms, of course).

Any pointers as to why there is a difference would be appreciated.
Thank you,
- Josiah

(I'm not subscribed, but I'll be checking for replies, and ccing me on
any replies would be appreciated)
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top