Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3da989c commit 150a664Copy full SHA for 150a664
1 file changed
Lib/test/test_global.py
@@ -4,15 +4,15 @@
4
5
import warnings
6
7
-warnings.filterwarnings("error", category=SyntaxWarning, module=__name__)
+warnings.filterwarnings("error", module="<test code>")
8
9
def compile_and_catch_warning(text):
10
try:
11
compile(text, "<test code>", "exec")
12
- except SyntaxWarning, msg:
13
- print "got SyntaxWarning as expected"
+ except SyntaxError, msg:
+ print "got SyntaxError as expected"
14
else:
15
- print "expected SyntaxWarning"
+ print "expected SyntaxError"
16
17
prog_text_1 = """
18
def wrong1():
0 commit comments