Guido van Rossum wrote: >>How should dummy_thread be modified? Something like >> >> def interrupt_main(): >> raise KeyboardInterrupt > > > I don't think dummy_thread needs to support this API. > Well, it does now. =) I modified dummy_thread to raise KeyboardInterrupt after executing a function passed to start_new_thread if interrupt_main is called. I think this simulates threading a little better since, calling this you have no clue how long it will take for your code to keep executing so might as well let whatever is running finish before the "main" thread gets its exception. The only issue I see is someone calling interrupt_main and expecting an instant raise of KeyboardInterrupt if they are in the main thread. Damn, I need to modify the code again. [A few minutes later...] OK, done. If someone thinks this is overblown then just back the changes out but I figure the module might as well *try* to simulate threads as best as it can without getting too complex. -Brett
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4