Skip to content

Commit

Permalink
Merge pull request #596 from schuhschuh/fix-python-future-statements
Browse files Browse the repository at this point in the history
fix: Recognize future statements with comma separated list of imports [Modules]
  • Loading branch information
schuhschuh committed May 4, 2016
2 parents 9e22d7d + 6ee3e53 commit 0d2d0aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmake/modules/CommonTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3188,7 +3188,7 @@ function (basis_configure_script INPUT OUTPUT)
# insert extra Python code near top, but after any future statement
# (http://docs.python.org/2/reference/simple_stmts.html#future)
set (FUTURE_STATEMENTS)
if (SCRIPT MATCHES "^(.*from[ \t]+__future__[ \t]+import[ \t]+[a-z_]+([ \t]+as[ \t]+[a-zA-Z_]+)?[ \t]*\n)(.*)$")
if (SCRIPT MATCHES "^(.*from[ \t]+__future__[ \t]+import[ \t]+[a-z_]+[^\n]*\n)(.*)$")
set (FUTURE_STATEMENTS "${CMAKE_MATCH_1}")
set (SCRIPT "${CMAKE_MATCH_3}")
endif ()
Expand Down
3 changes: 2 additions & 1 deletion test/cmake/test_future_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
from __future__ import division


from __future__ import generators
from __future__ import generators, with_statement
from __future__ import unicode_literals



from __future__ import with_statement

from __future__ import print_function, division, unicode_literals


from basis import utilities
Expand Down

0 comments on commit 0d2d0aa

Please sign in to comment.