bpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. (GH-8262)
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 10605db..f6f06c7 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1348,6 +1348,10 @@
msg = "unexpected indent";
else if (err->token == DEDENT)
msg = "unexpected unindent";
+ else if (err->expected == NOTEQUAL) {
+ errtype = PyExc_SyntaxError;
+ msg = "with Barry as BDFL, use '<>' instead of '!='";
+ }
else {
errtype = PyExc_SyntaxError;
msg = "invalid syntax";