File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,19 +89,23 @@ def test_parserhack(self):
8989 # the parser hack disabled. If a new keyword is introduced in
9090 # 2.6, change this to refer to the new future import.
9191 try :
92- exec "from __future__ import division, with_statement; with = 0"
92+ exec "from __future__ import print_function; print 0"
9393 except SyntaxError :
9494 pass
9595 else :
9696 self .fail ("syntax error didn't occur" )
9797
9898 try :
99- exec "from __future__ import (with_statement, division ); with = 0"
99+ exec "from __future__ import (print_function ); print 0"
100100 except SyntaxError :
101101 pass
102102 else :
103103 self .fail ("syntax error didn't occur" )
104104
105+ def test_multiple_features (self ):
106+ test_support .unload ("test.test_future5" )
107+ from test import test_future5
108+
105109
106110def test_main ():
107111 test_support .run_unittest (FutureTest )
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ What's New in Python 2.7 alpha 1
1212Core and Builtins
1313-----------------
1414
15+ - Issue #4209: Enabling unicode_literals and the print_function in the same
16+ __future__ import didn't work.
17+
1518- Using ``nonlocal`` as a variable name will now raise a Py3k SyntaxWarning
1619 because it is a reserved word in 3.x.
1720
Original file line number Diff line number Diff line change @@ -206,13 +206,10 @@ future_hack(parser_state *ps)
206206 char * str_ch = STR (CHILD (cch , 0 ));
207207 if (strcmp (str_ch , FUTURE_WITH_STATEMENT ) == 0 ) {
208208 ps -> p_flags |= CO_FUTURE_WITH_STATEMENT ;
209- break ;
210209 } else if (strcmp (str_ch , FUTURE_PRINT_FUNCTION ) == 0 ) {
211210 ps -> p_flags |= CO_FUTURE_PRINT_FUNCTION ;
212- break ;
213211 } else if (strcmp (str_ch , FUTURE_UNICODE_LITERALS ) == 0 ) {
214212 ps -> p_flags |= CO_FUTURE_UNICODE_LITERALS ;
215- break ;
216213 }
217214 }
218215 }
You can’t perform that action at this time.
0 commit comments