Message286672
| Author |
mark.dickinson |
| Recipients |
Arfrever, belopolsky, gdr@garethrees.org, luc, mark.dickinson, refi64, serhiy.storchaka, terry.reedy |
| Date |
2017年02月01日.18:19:47 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1485973187.5.0.67981917793.issue14376@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The test portion of the existing patch doesn't apply cleanly to 2.7 tip. Here's an updated patch that does, with slightly expanded tests and a Misc/NEWS entry.
There was discussion above about two overflow cases: C long to C int, and C int to byte, but with this patch there's now a 3rd overflow case to consider, namely Python long to C long. In this case PyInt_AsLong sets an exception and returns -1, and since we don't check for exceptions that -1 then gets used as the exit code. I'm not sure whether that's the right thing to do or not, but it does match what Python 3 currently does, and that's good enough for me. |
|