473,387 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 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)

Jun 28 '06 #1
0 1026

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Raja | last post by:
Hi, I want to override the sys.settrace() call, create a way to trace the execution of a python program. Keep track of all objects created and destroyed. Keep track of the call pattern throughout...
0
by: Raja | last post by:
Hi, I want to override the sys.settrace() call, create a way to trace the execution of a python program. Keep track of all objects created and destroyed. Keep track of the call pattern throughout...
0
by: Raja | last post by:
Hi, I want to override the sys.settrace() call, create a way to trace the execution of a python program. Keep track of all objects created and destroyed. Keep track of the call pattern throughout...
3
by: Raja | last post by:
Hi, I want to override the sys.settrace() call, create a way to trace the execution of a python program. Keep track of all objects created and destroyed. Keep track of the call pattern throughout...
1
by: tleeuwenburg | last post by:
The code below produces no output. I would expect to see: tracing... tracing... tracing... tracing... tracing... I was wondering if anyone had any experience with this.
0
by: Michal Kwiatkowski | last post by:
I'm building a tool to trace all function calls using sys.settrace function from the standard library. One of the awkward behaviors of this facility is that the class definitions are reported as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.