compiler: don't emit SyntaxWarning on const stmt

Issue #26204: the compiler doesn't emit SyntaxWarning warnings anymore when
constant statements are ignored.
This commit is contained in:
Victor Stinner 2016-02-08 22:45:06 +01:00
parent 896632ea6b
commit 15a3095d64
5 changed files with 28 additions and 76 deletions

View file

@ -7,7 +7,6 @@ import unittest
import sys
# testing import *
from sys import *
from test import support
class TokenTests(unittest.TestCase):
@ -425,11 +424,8 @@ class GrammarTests(unittest.TestCase):
# Tested below
def test_expr_stmt(self):
msg = 'ignore constant statement'
with support.check_warnings((msg, SyntaxWarning)):
exec("1")
# (exprlist '=')* exprlist
1
1, 2, 3
x = 1
x = 1, 2, 3