From: Jeremy Hylton Date: Wed, 28 Feb 2001 22:50:15 +0000 (+0000) Subject: Fix filter for SyntaxErrors X-Git-Tag: v2.1b1~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=150a6640f5f63d2dd32e823b619b6afdf3d1b8c1;p=python Fix filter for SyntaxErrors --- diff --git a/Lib/test/test_global.py b/Lib/test/test_global.py index 66f2a6e0f6..c60d0c7b29 100644 --- a/Lib/test/test_global.py +++ b/Lib/test/test_global.py @@ -4,15 +4,15 @@ from test_support import check_syntax import warnings -warnings.filterwarnings("error", category=SyntaxWarning, module=__name__) +warnings.filterwarnings("error", module="") def compile_and_catch_warning(text): try: compile(text, "", "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():