Message380876
This seems to happen only when both arguments to exec are used:
```
Python 3.7.7 (default, Mar 10 2020, 15:43:27)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exec('text = ["hallo"]\ntext.append("Welt")\nprint(" ".join([text[i] for i in range(0, 2)]))')
hallo Welt
>>> exec('text = ["hallo"]\ntext.append("Welt")\nprint(" ".join([text[i] for i in range(0, 2)]))', {})
hallo Welt
>>> exec('text = ["hallo"]\ntext.append("Welt")\nprint(" ".join(text))', {}, {})
hallo Welt
>>> exec('text = ["hallo"]\ntext.append("Welt")\nprint(" ".join([text[i] for i in range(0, 2)]))', {}, {})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 3, in <module>
File "<string>", line 3, in <listcomp>
NameError: name 'text' is not defined
``` |
|
Date |
User |
Action |
Args |
2020-11-13 11:43:19 | alex0kamp | set | recipients:
+ alex0kamp, qpeter |
2020-11-13 11:43:19 | alex0kamp | set | messageid: <1605267799.23.0.629607174617.issue41918@roundup.psfhosted.org> |
2020-11-13 11:43:19 | alex0kamp | link | issue41918 messages |
2020-11-13 11:43:19 | alex0kamp | create | |
|