diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_support.py | 8 |
1 files changed, 2 insertions, 6 deletions
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 @@ def make_bad_fd(): 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 |