Skip to content
Myr

lazy loading preserves click context

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent 3897a51 · Browse files · 2 files+11 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−0 removed

  • other:+11 added−0 removed

2 files+11 added−0 removed

modified:src/flask/cli.py+8 added
299 unmodified lines
300 else:301 self._load_in_background()302303 def _load_in_background(self):304 # Store the Click context and push it in the loader thread so305 # script_info is still available.306 ctx = click.get_current_context(silent=True)307308 def _load_app():309 __traceback_hide__ = True # noqa: F841310311 with self._lock:312 if ctx is not None:313 click.globals.push_context(ctx)314315 try:316 self._load_unlocked()317 except Exception as e:318 self._bg_loading_exc = e
671 unmodified lines
modified:CHANGES.rst+3 added
40 unmodified lines
41 :issue:`3396`42- Add an ``--exclude-patterns`` option to the ``flask run`` CLI43 command to specify patterns that will be ignored by the reloader.44 :issue:`4188`45- When using lazy loading (the default with the debugger), the Click46 context from the ``flask run`` command remains available in the47 loader thread. :issue:`4460`484950Version 2.0.351-------------
1199 unmodified lines