zulip/tools/lib
Anders Kaseorg 9fc0aa7ffa scripts: Fix exec invocation for in-process virtualenv activation.
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>
2019-04-16 17:42:44 -07:00
..
__init__.py
capitalization.py popovers: Add a clear status option in user popover. 2019-02-26 14:40:17 -08:00
find_add_class.py settings: Fix color styling for nested inputs to work in night mode. 2018-08-08 11:29:48 -07:00
gitlint-rules.py lint: Allow revert commit messages in gitlint. 2018-02-13 09:21:01 -08:00
graph.py Remove inheritance from object. 2017-11-06 08:53:48 -08:00
html_branches.py Remove inheritance from object. 2017-11-06 08:53:48 -08:00
html_grep.py Remove inheritance from object. 2017-11-06 08:53:48 -08:00
pretty_print.py tools: Remove unused imports. 2019-02-02 17:10:31 -08:00
provision.py scripts: Fix exec invocation for in-process virtualenv activation. 2019-04-16 17:42:44 -07:00
sanity_check.py python: Mark intentionally unused imports with noop statements. 2019-02-22 16:54:47 -08:00
template_parser.py linter: Make multiline handlebar singleton tags use 2 space indentation. 2018-04-07 20:08:38 -07:00
test_script.py provision_version: Move to under UUID_VAR_PATH. 2017-10-17 21:15:58 -07:00
test_server.py tools: Remove unused imports. 2019-02-02 17:10:31 -08:00