Issue 16714: Raise exceptions, don't throw (original) (raw)

Created on 2012-12-18 18:11 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
raise-3.3.patch serhiy.storchaka,2012-12-18 18:11 Patch for 3.3+ review
raise-3.2.patch serhiy.storchaka,2012-12-18 18:12 Patch for 3.2 review
raise-2.7.patch serhiy.storchaka,2012-12-18 18:13 Patch for 2.7 review
raise-2.7_2.patch serhiy.storchaka,2012-12-18 19:02 review
raise-3.3_2.patch serhiy.storchaka,2012-12-18 19:02 review
raise-3.2_2.patch serhiy.storchaka,2012-12-18 19:02 review
throw_away.patch serhiy.storchaka,2012-12-19 16:17 Revert 'raise' to 'throw'. Patch for 2.7 review
threw2raised.patch serhiy.storchaka,2012-12-19 16:17 Replace 'threw' to 'raised'. Patch for 3.3 and 3.4 review
threw2raised-3.2.patch serhiy.storchaka,2012-12-19 16:17 Replace 'threw' to 'raised'. Patch for 2.7 and 3.2 review
Messages (9)
msg177698 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-18 18:11
The proposed patch fixes wording of documentation, comments, etc which use the term 'throw' instead of 'raise' in context of exception raising.
msg177699 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2012-12-18 18:41
LGTM, except for: diff -r 907d71668d3c Python/pythonrun.c --- a/Python/pythonrun.c Sun Dec 16 21:10:35 2012 +0100 +++ b/Python/pythonrun.c Tue Dec 18 19:35:27 2012 +0200 @@ -2518,7 +2518,7 @@ PyOS_CheckStack(void) { __try { - /* alloca throws a stack overflow exception if there's + /* alloca raises a stack overflow exception if there's not enough space left on the stack */ alloca(PYOS_STACK_MARGIN * sizeof(void*)); return 0; This is talking about a C++ exception and therefore "throw" is correct.
msg177700 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-18 19:02
Indeed. Here are updated patches.
msg177701 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-12-18 19:27
New changeset fdf907708f49 by Andrew Svetlov in branch '3.2': Issue #16714: use 'raise' exceptions, don't 'throw'. http://hg.python.org/cpython/rev/fdf907708f49 New changeset 15a391919deb by Andrew Svetlov in branch '3.3': Issue #16714: use 'raise' exceptions, don't 'throw'. http://hg.python.org/cpython/rev/15a391919deb New changeset 7260cf668dd7 by Andrew Svetlov in branch 'default': Issue #16714: use 'raise' exceptions, don't 'throw'. http://hg.python.org/cpython/rev/7260cf668dd7 New changeset 8c2635afbfe1 by Andrew Svetlov in branch '2.7': Issue #16714: use 'raise' exceptions, don't 'throw'. http://hg.python.org/cpython/rev/8c2635afbfe1
msg177702 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-12-18 19:28
Fixed. Thanks, Serhiy.
msg177755 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-12-19 16:17
I found one error. In Lib/email/header.py for 2.7 'raise' should be reverted to 'throw'. Also I miss a past form. Second patch replaces 'threw' with 'raised'.
msg177779 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-12-19 20:47
New changeset 0a5c5399f638 by Andrew Svetlov in branch '2.7': revert comment wording (#16714) http://hg.python.org/cpython/rev/0a5c5399f638
msg177780 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-12-19 20:55
New changeset b227f8f7242d by Andrew Svetlov in branch '2.7': replace threw with raised (#16714) http://hg.python.org/cpython/rev/b227f8f7242d New changeset 74da2dbb5e50 by Andrew Svetlov in branch '3.2': replace threw with raised (#16714) http://hg.python.org/cpython/rev/74da2dbb5e50 New changeset 55d86476d048 by Andrew Svetlov in branch '3.3': replace threw with raised (#16714) http://hg.python.org/cpython/rev/55d86476d048 New changeset 3594175c6860 by Andrew Svetlov in branch 'default': replace threw with raised (#16714) http://hg.python.org/cpython/rev/3594175c6860
msg177781 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-12-19 20:56
Committed. Thanks again, Serhiy!
History
Date User Action Args
2022-04-11 14:57:39 admin set github: 60918
2012-12-19 20:56:38 asvetlov set messages: +
2012-12-19 20:55:54 python-dev set messages: +
2012-12-19 20:47:15 python-dev set messages: +
2012-12-19 16:17:59 serhiy.storchaka set files: + throw_away.patch, threw2raised.patch, threw2raised-3.2.patchmessages: +
2012-12-18 19:28:42 asvetlov set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2012-12-18 19:27:57 python-dev set nosy: + python-devmessages: +
2012-12-18 19:02:43 serhiy.storchaka set files: + raise-2.7_2.patch, raise-3.3_2.patch, raise-3.2_2.patchmessages: +
2012-12-18 18:41:26 georg.brandl set nosy: + georg.brandlmessages: +
2012-12-18 18:17:21 chris.jerdonek set nosy: + chris.jerdonek
2012-12-18 18:13:42 serhiy.storchaka link issue16648 dependencies
2012-12-18 18:13:11 serhiy.storchaka set files: + raise-2.7.patch
2012-12-18 18:12:13 serhiy.storchaka set files: + raise-3.2.patch
2012-12-18 18:11:29 serhiy.storchaka create