mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Don't forget about redeclaration under except (PY-28593)
This commit is contained in:
@@ -172,7 +172,7 @@ public class PyRedeclarationInspection extends PyInspection {
|
||||
final PsiElement element = instruction.getElement();
|
||||
if (element == null) return false;
|
||||
|
||||
if (element instanceof PyTryExceptStatement || element instanceof PyConditionalExpression) return true;
|
||||
if (element instanceof PyTryPart || element instanceof PyExceptPart || element instanceof PyConditionalExpression) return true;
|
||||
|
||||
if (element instanceof PyForStatement) {
|
||||
final PyForPart forPart = ((PyForStatement)element).getForPart();
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
try:
|
||||
import a
|
||||
except:
|
||||
a = None
|
||||
@@ -164,6 +164,11 @@ public class PyRedeclarationInspectionTest extends PyInspectionTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-28593
|
||||
public void testRedeclarationInExcept() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Class<? extends PyInspection> getInspectionClass() {
|
||||
|
||||
Reference in New Issue
Block a user