This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2016年09月10日 19:49 by mark.dickinson, last changed 2022年04月11日 14:58 by admin.
| Messages (3) | |||
|---|---|---|---|
| msg275687 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2016年09月10日 19:49 | |
Modules/signalmodule.c contains this code: if (handler == IgnoreHandler) func = SIG_IGN; else if (handler == DefaultHandler) func = SIG_DFL; ... Here IgnoreHandler and DefaultHandler are ints. The code above effectively does an "is" comparison with those ints, assuming that SIG_IGN and SIG_DFL are amongst the small interned ints. |
|||
| msg275688 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2016年09月10日 19:52 | |
Also applies to 2.7, 3.5. |
|||
| msg275696 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年09月10日 20:54 | |
This was not a problem before 3.5 since IgnoreHandler and DefaultHandler were singletons exposed in the signal module as SIG_DFL and SIG_IGN. But in issue21076 they were converted to enums. This involves converting between enums and ints. All works only while SIG_DFL and SIG_IGN are small integers and there is small integer cache. I proposed either revert this change (signal_no_enum_handlers.patch in issue21076) or even make SIG_DFL and SIG_IGN non-integer singletons (issue23325). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:36 | admin | set | github: 72256 |
| 2018年08月23日 23:54:00 | berker.peksag | set | nosy:
+ berker.peksag components: + Library (Lib) |
| 2016年09月10日 20:54:08 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg275696 |
| 2016年09月10日 19:52:20 | mark.dickinson | set | messages:
+ msg275688 versions: + Python 2.7, Python 3.5 |
| 2016年09月10日 19:49:19 | mark.dickinson | create | |