mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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:
parent
896632ea6b
commit
15a3095d64
5 changed files with 28 additions and 76 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue