Fix test_grammar so that it ignores warning about global stmt at
module level in exec.
got SyntaxError as expected
got SyntaxError as expected
got SyntaxError as expected
+got SyntaxError as expected
global x
"""
compile_and_catch_warning(prog_text_3)
+
+prog_text_4 = """
+global x
+x = 2
+"""
+compile_and_catch_warning(prog_text_4)
if g != {'z': 1}: raise TestFailed, 'exec \'z = 1\' in g'
g = {}
l = {}
+
+import warnings
+warnings.filterwarnings("ignore", "global statement", module="<string>")
exec 'global a; a = 1; b = 2' in g, l
if g.has_key('__builtins__'): del g['__builtins__']
if l.has_key('__builtins__'): del l['__builtins__']