Skip to content

Commit d176b08

Browse files
committed
fix and update tests
1 parent b2c9971 commit d176b08

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Lib/test/test_syntax.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3517,7 +3517,7 @@ def test_diamond_operator(self):
35173517

35183518
def test_diamond_operator_barry_as_flufl(self):
35193519
self._check_error(
3520-
"from __future__ import barry_as_FLUFL\n1 < > 2",
3520+
"from __future__ import barry_as_FLUFL\n1 < > 2",
35213521
"Maybe you meant '<>' instead of '< >'",
35223522
lineno=2,
35233523
end_lineno=2,
@@ -3528,7 +3528,7 @@ def test_diamond_operator_barry_as_flufl(self):
35283528
def test_triple_equal(self):
35293529
self._check_error(
35303530
"a === b",
3531-
"Maybe you meant 'is' instead of '==='?",
3531+
r"Maybe you meant 'is' instead of '==='\?",
35323532
lineno=1,
35333533
end_lineno=1,
35343534
offset=3,
@@ -3538,7 +3538,7 @@ def test_triple_equal(self):
35383538
def test_eq_lt_typo(self):
35393539
self._check_error(
35403540
"a =< b",
3541-
"Maybe you meant '<=' instead of '=<'?",
3541+
r"Maybe you meant '<=' instead of '=<'\?",
35423542
lineno=1,
35433543
end_lineno=1,
35443544
offset=3,
@@ -3548,7 +3548,7 @@ def test_eq_lt_typo(self):
35483548
def test_eq_gt_typo(self):
35493549
self._check_error(
35503550
"a => b",
3551-
"Maybe you meant '>=' instead of '=>'?",
3551+
r"Maybe you meant '>=' instead of '=>'\?",
35523552
lineno=1,
35533553
end_lineno=1,
35543554
offset=3,
@@ -3558,7 +3558,7 @@ def test_eq_gt_typo(self):
35583558
def test_eq_bang_typo(self):
35593559
self._check_error(
35603560
"a =! b",
3561-
"Maybe you meant '!=' instead of '=!'?",
3561+
r"Maybe you meant '!=' instead of '=!'\?",
35623562
lineno=1,
35633563
end_lineno=1,
35643564
offset=3,

Parser/action_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ _PyPegen_check_barry_as_flufl(Parser *p, Token* t) {
932932
}
933933
if (!(p->flags & PyPARSE_BARRY_AS_BDFL)) {
934934
if (strcmp(tok_str, "<>") == 0) {
935-
RAISE_SYNTAX_ERROR("Are you trying to overthrow the SC? Use operator \"!=\"!");
935+
RAISE_SYNTAX_ERROR("invalid syntax. Are you trying to overthrow the SC? Use operator \"!=\"!");
936936
return -1;
937937
}
938938
return strcmp(tok_str, "!=");

0 commit comments

Comments
 (0)