Bugs item #1779233, was opened at 2007-08-22 10:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1779233&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Threads
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Rotem (rotem_yaari)
Assigned to: Nobody/Anonymous (nobody)
Summary: PyThreadState_SetAsyncExc and the main thread

Initial Comment:
Hi,

The following does not work in python 2.5:
##############################################
import ctypes
import thread
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(
               thread.get_ident(),        
               ctypes.py_object(SystemExit))
##############################################

Although according to my understanding this should "schedule" an async 
exception for the main thread, it does not (res receives the value of 0).

When raising exceptions in other threads in this way, it works and the call to 
PyThreadState_SetAsyncExc returns 1 like it should. Doing so on the main thread 
doesn't seem to work, even when performed from threads other than the main one.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1779233&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to