this is better written using assertRaises
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 5186a57..df3dce6 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -370,12 +370,8 @@
unlink(TESTFN)
def check_syntax_error(testcase, statement):
- try:
- compile(statement, '<test string>', 'exec')
- except SyntaxError:
- pass
- else:
- testcase.fail('Missing SyntaxError: "%s"' % statement)
+ testcase.assertRaises(SyntaxError, compile, statement,
+ '<test string>', 'exec')
def open_urlresource(url):
import urllib, urlparse