sys.settrace() and Python 2.3

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Josiah Carlson

    #1

    sys.settrace() and Python 2.3


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

    import sys

    def goo():
    while 1:
    pass

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

    sys.settrace(fo o)

    goo()

    In Python 2.3, the above call to goo() doesn't seem to ever return. It
    exits with a KeyboardInterru pt 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)

Working...