Message376348
| Author |
vstinner |
| Recipients |
vstinner |
| Date |
2020年09月04日.10:03:39 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1599213819.47.0.595110113151.issue41713@roundup.psfhosted.org> |
| In-reply-to |
| Content |
The signal module is really special. In Python, only the main thread of the main interpreter is supposed to be allowed to run Python signal handlers (but the C signal handler can be executed by any thread).
The exec function of the _signal module runs actions each time a new instance of the _signal module is created, whereas some actions must only be done exactly once:
* modify Handlers[i].tripped
* modify Handlers[i].func
* Set SIGINT signal handler
* Initialize sigint_event event (Windows only): see bpo-41686
For example, calling signal.signal() in a subinterpreter raises ValueError("signal only works in main thread of the main interpreter"). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2020年09月04日 10:03:39 | vstinner | set | recipients:
+ vstinner |
| 2020年09月04日 10:03:39 | vstinner | set | messageid: <1599213819.47.0.595110113151.issue41713@roundup.psfhosted.org> |
| 2020年09月04日 10:03:39 | vstinner | link | issue41713 messages |
| 2020年09月04日 10:03:39 | vstinner | create |
|