Fix filter for SyntaxErrors
diff --git a/Lib/test/test_global.py b/Lib/test/test_global.py
index 66f2a6e..c60d0c7 100644
--- a/Lib/test/test_global.py
+++ b/Lib/test/test_global.py
@@ -4,15 +4,15 @@
 
 import warnings
 
-warnings.filterwarnings("error", category=SyntaxWarning, module=__name__)
+warnings.filterwarnings("error", module="<test code>")
 
 def compile_and_catch_warning(text):
     try:
         compile(text, "<test code>", "exec")
-    except SyntaxWarning, msg:
-        print "got SyntaxWarning as expected"
+    except SyntaxError, msg:
+        print "got SyntaxError as expected"
     else:
-        print "expected SyntaxWarning"
+        print "expected SyntaxError"
 
 prog_text_1 = """
 def wrong1():