summaryrefslogtreecommitdiff
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index c000028e5f..5d3ce4cd9f 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -882,6 +882,14 @@ leading to spurious errors.
Traceback (most recent call last):
SyntaxError: cannot assign to attribute here. Maybe you meant '==' instead of '='?
+Custom error messages for try blocks that are not followed by except/finally
+
+ >>> try:
+ ... x = 34
+ ...
+ Traceback (most recent call last):
+ SyntaxError: expected 'except' or 'finally' block
+
Ensure that early = are not matched by the parser as invalid comparisons
>>> f(2, 4, x=34); 1 $ 2
Traceback (most recent call last):