mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Add test case for global stmt at module level.
Fix test_grammar so that it ignores warning about global stmt at module level in exec.
This commit is contained in:
parent
3dd5ad3b4f
commit
2922ea8235
3 changed files with 10 additions and 0 deletions
|
@ -37,3 +37,9 @@ def wrong3():
|
|||
global x
|
||||
"""
|
||||
compile_and_catch_warning(prog_text_3)
|
||||
|
||||
prog_text_4 = """
|
||||
global x
|
||||
x = 2
|
||||
"""
|
||||
compile_and_catch_warning(prog_text_4)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue