[issue27757] eval() does not allow import statements to run.

2016-08-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: Correction: `importlib.import_module` is also available in Python 2.7. -- ___ Python tracker ___ __

[issue27757] eval() does not allow import statements to run.

2016-08-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: That is not a bug, it is a feature. `eval` only evaluates *expressions*, not statements, and `import` is a statement. Neither of those is going to change. Starting in Python 3.1, you could use `import_module`: https://docs.python.org/3/library/importlib.html#

[issue27757] eval() does not allow import statements to run.

2016-08-13 Thread Decorater
New submission from Decorater: runnign exec on import lines are fine however if I run the following code in a exec: >>>import py2pycx;py2pycx.api.compress_script(sys.path[0] + >>>'\resources\Dependencies', 'six.py') Traceback (most recent call last): File ".\resources\Dependencies\DecoraterB

[issue27757] eval() does not allow import statements to run.

2016-08-13 Thread Decorater
Decorater added the comment: eval* my typo is OP -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai