mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
Mark raise with no args under finally as an error because it leads to an exception in runtime on Python 2.7 (PY-29763)
This commit is contained in:
@@ -264,8 +264,7 @@ public abstract class CompatibilityVisitor extends PyAnnotator {
|
||||
registerForAllMatchingVersions(level -> UnsupportedFeaturesUtil.raiseHasNoArgsUnderFinally(node, level),
|
||||
" not support this syntax. Raise with no arguments can only be used in an except block",
|
||||
node,
|
||||
null,
|
||||
false);
|
||||
null);
|
||||
|
||||
// raise 1, 2, 3
|
||||
registerForAllMatchingVersions(level -> UnsupportedFeaturesUtil.raiseHasMoreThenOneArg(node, level),
|
||||
|
||||
@@ -9,4 +9,4 @@ except:
|
||||
try:
|
||||
raise ValueError
|
||||
finally:
|
||||
raise
|
||||
<error descr="Python version 2.7 does not support this syntax. Raise with no arguments can only be used in an except block">raise</error>
|
||||
@@ -1,4 +1,4 @@
|
||||
try:
|
||||
raise ValueError
|
||||
finally:
|
||||
<warning descr="Python version 2.6, 2.7 do not support this syntax. Raise with no arguments can only be used in an except block"><warning descr="Python version 2.7 does not support this syntax. Raise with no arguments can only be used in an except block">raise</warning></warning>
|
||||
<error descr="Python version 2.7 does not support this syntax. Raise with no arguments can only be used in an except block"><warning descr="Python version 2.6, 2.7 do not support this syntax. Raise with no arguments can only be used in an except block">raise</warning></error>
|
||||
Reference in New Issue
Block a user