mirror of
https://github.com/zulip/zulip.git
synced 2026-06-12 21:00:58 +08:00
activate_this.py has always documented that it should be exec()ed with
locals = globals, and in virtualenv 16.0.0 it raises a NameError
otherwise.
As a simplified demonstration of the weird things that can go wrong
when locals ≠ globals:
>>> exec('a = 1; print([a])', {}, {})
[1]
>>> exec('a = 1; print([a for b in [1]])', {}, {})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <module>
File "<string>", line 1, in <listcomp>
NameError: name 'a' is not defined
>>> exec('a = 1; print([a for b in [1]])', {})
[1]
Top-level assignments go into locals, but from inside a new scope like
a list comprehension, they’re read out of globals, which doesn’t work.
Fixes #12030.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
|
||
|---|---|---|
| .. | ||
| third | ||
| __init__.py | ||
| build-pgroonga | ||
| build-tsearch-extras | ||
| cd_exec | ||
| certbot-maybe-renew | ||
| check-upstart | ||
| clean_emoji_cache.py | ||
| clean_node_cache.py | ||
| clean_venv_cache.py | ||
| clean-unused-caches | ||
| create-production-venv | ||
| create-thumbor-venv | ||
| email-mirror-postfix | ||
| hash_reqs.py | ||
| install | ||
| install-node | ||
| install-shellcheck | ||
| node_cache.py | ||
| process-mobile-i18n | ||
| pythonrc.py | ||
| queue_workers.py | ||
| setup_path_on_import.py | ||
| setup_venv.py | ||
| setup-apt-repo | ||
| setup-apt-repo-debathena | ||
| setup-yum-repo | ||
| unpack-zulip | ||
| upgrade-zulip | ||
| upgrade-zulip-from-git | ||
| upgrade-zulip-stage-2 | ||
| zulip_tools.py | ||