I have a module, defined in .../application/modules/titles_in_packages.py.

It uses the print function and so contains:

from __future__ import with_statement, print_function

When the module is imported, (in a controller):

import titles_in_packages

it fails with a syntax error unless the import is preceeded by:

from __future__ import print_function

However this precipitates another error:

Traceback (most recent call last):
  File "gluon/restricted.py", line 204, in restricted
  File "gluon/restricted.py", line 189, in compile2
SyntaxError: future feature print_function is not defined 
(controllers/default.py, line 2)

Any hints?


Reply via email to