消息 [242849]
Since it took me a moment to figure out why the extra incref was needed:
* both PyException_SetCause and PyException_SetContext steal a reference to their second argument
* hence we need the second incref, rather than relying solely on the reference received from PyErr_NormalizeException
This does suggest the new incref is conceptually in the wrong spot - it should be before the call to PyException_SetCause, such that this block of code *always* possesses a valid reference while accessing "val". At the moment, we technically still don't have an active reference when passing "val" to PyException_SetContext. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2015-05-10 03:40:47 | ncoghlan | 修改 | recipients:
+ ncoghlan, gvanrossum, rhettinger, belopolsky, scoder, vstinner, r.david.murray, ethan.furman, Yury.Selivanov, python-dev, schlamar, Rosuav, berker.peksag, serhiy.storchaka, yselivanov, NeilGirdhar |
| 2015-05-10 03:40:46 | ncoghlan | 修改 | messageid: <1431229246.92.0.00770129146818.issue22906@psf.upfronthosting.co.za> |
| 2015-05-10 03:40:46 | ncoghlan | 链接 | issue22906 messages |
| 2015-05-10 03:40:46 | ncoghlan | 创建 | |
|