diff --git a/python/src/com/jetbrains/python/inspections/PyCompatibilityInspection.java b/python/src/com/jetbrains/python/inspections/PyCompatibilityInspection.java index a0fe21d7f8b5..5c4d63bdd0d0 100644 --- a/python/src/com/jetbrains/python/inspections/PyCompatibilityInspection.java +++ b/python/src/com/jetbrains/python/inspections/PyCompatibilityInspection.java @@ -584,7 +584,7 @@ public class PyCompatibilityInspection extends PyInspection { while (!st.isEmpty()) { PsiElement el = st.pop(); if (el instanceof PyYieldExpression) - registerProblem(node, "Python version 2.4 doesn't support this syntax." + + registerProblem(node, "Python version 2.4 doesn't support this syntax. " + "In Python <= 2.4, yield was a statement; it didn’t return any value."); else { for (PsiElement e : el.getChildren()) diff --git a/python/src/com/jetbrains/python/validation/UnsupportedFeatures.java b/python/src/com/jetbrains/python/validation/UnsupportedFeatures.java index 079cd7e9e87a..0deaa91d5d9d 100644 --- a/python/src/com/jetbrains/python/validation/UnsupportedFeatures.java +++ b/python/src/com/jetbrains/python/validation/UnsupportedFeatures.java @@ -321,7 +321,7 @@ public class UnsupportedFeatures extends PyAnnotator { while (!st.isEmpty()) { PsiElement el = st.pop(); if (el instanceof PyYieldExpression) - getHolder().createWarningAnnotation(node, "Python version 2.4 doesn't support this syntax." + + getHolder().createWarningAnnotation(node, "Python version 2.4 doesn't support this syntax. " + "In Python <= 2.4, yield was a statement; it didn’t return any value."); else { for (PsiElement e : el.getChildren()) diff --git a/python/testData/inspections/PyCompatibilityInspection/test.py b/python/testData/inspections/PyCompatibilityInspection/test.py index 7f8a110da0e7..fec63feb9933 100644 --- a/python/testData/inspections/PyCompatibilityInspection/test.py +++ b/python/testData/inspections/PyCompatibilityInspection/test.py @@ -65,5 +65,28 @@ import Bast var = Bastion.BastionClass() ######################## +def foo(): # PY-2796 + a = (yield 1) -raise \ No newline at end of file +######################## + +raise + +######################## +# PY-2792 +x = True if condition else False + +######################## +# PY-2792 + +def unified_tef(): + try: + pass + except ImportError: + pass + except KeyError: + pass + else: + pass + finally: + pass