Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- On Ubuntu 14.04:
- $ python --version
- Python 2.7.6
- $ python
- Python 2.7.6 (default, Oct 26 2016, 20:30:19)
- [GCC 4.8.4] on linux2
- Type "help", "copyright", "credits" or "license" for more information.
- >>> def print_arg(arg):
- ... def do_print():
- ... print(arg)
- ... exec('do_print()', {}, {})
- ...
- File "<stdin>", line 4
- SyntaxError: unqualified exec is not allowed in function 'print_arg' it contains a nested function with free variables
- >>>
- On OS X 10.11.6:
- $ python --version
- Python 2.7.10
- $ python
- Python 2.7.10 (default, Oct 23 2015, 19:19:21)
- [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
- Type "help", "copyright", "credits" or "license" for more information.
- >>> def print_arg(arg):
- ... def do_print():
- ... print(arg)
- ... exec('do_print()', {}, {})
- ...
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement