1 # Test various flavors of legal and illegal future statements
3 from test_support
import unload
6 rx
= re
.compile('\((\S+).py, line (\d+)')
8 def check_error_location(msg
):
10 print "SyntaxError %s %s" % mo
.group(1, 2)
12 # The first two tests should work
14 unload('test_future1')
17 unload('test_future2')
20 # The remaining tests should fail
23 except SyntaxError, msg
:
24 check_error_location(str(msg
))
28 except SyntaxError, msg
:
29 check_error_location(str(msg
))
33 except SyntaxError, msg
:
34 check_error_location(str(msg
))
38 except SyntaxError, msg
:
39 check_error_location(str(msg
))
43 except SyntaxError, msg
:
44 check_error_location(str(msg
))