Merged revisions 67066 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67066 | benjamin.peterson | 2008-10-30 21:16:05 -0500 (Thu, 30 Oct 2008) | 5 lines

  make sure the parser flags and passed onto the compiler

  This fixes "from __future__ import unicode_literals" in an exec statment
  See #4225
........
This commit is contained in:
Benjamin Peterson 2008-10-31 02:26:20 +00:00
parent f4d016f38a
commit 084ce7a5dc
5 changed files with 65 additions and 13 deletions

View file

@ -106,6 +106,11 @@ class FutureTest(unittest.TestCase):
test_support.unload("test.test_future5")
from test import test_future5
def test_unicode_literals_exec(self):
scope = {}
exec "from __future__ import unicode_literals; x = ''" in scope
self.assertTrue(isinstance(scope["x"], unicode))
def test_main():
test_support.run_unittest(FutureTest)