summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/output/test_global1
-rw-r--r--Lib/test/test_global.py6
-rw-r--r--Lib/test/test_grammar.py3
3 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/output/test_global b/Lib/test/output/test_global
index 0c96cfa..ba92813 100644
--- a/Lib/test/output/test_global
+++ b/Lib/test/output/test_global
@@ -2,3 +2,4 @@ test_global
got SyntaxError as expected
got SyntaxError as expected
got SyntaxError as expected
+got SyntaxError as expected
diff --git a/Lib/test/test_global.py b/Lib/test/test_global.py
index c60d0c7..b41b7d4 100644
--- a/Lib/test/test_global.py
+++ b/Lib/test/test_global.py
@@ -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)
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 587d7ec..75a55b9 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -411,6 +411,9 @@ if g.has_key('__builtins__'): del g['__builtins__']
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__']