View Single Post
Old 06-11-2011, 05:35 PM   #40
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
Perhaps a good solution is to raise an exception in FD.__init__ if the current thread is not the GUI thread.
That is a good idea. Clearly the intent is that the FD be instantiated on a thread with an event loop. There is supposed to be only one of those, so checking that invariant seems excellent. It also makes the changes to check for is_gui_thread completely correct, because the only possible signal recipient is that thread.

I assume you will make the change...

EDIT: should Dispatcher make the same check? It clearly is making the same assumption.
chaley is offline   Reply With Quote