Skip to content
Myr

Lazy asyncsupport.patch_all()

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

fixes #765

authored by INADA Naoki · committed by INADA Naoki · parent c0c3b78 · Browse files · 3 files+5 added−11 removed
This commit

State

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

Diff stats

3 files+5 added−11 removed

  • other:+5 added−11 removed

3 files+5 added−11 removed

modified:jinja2/__init__.py-11 removed
68 unmodified lines
69 'environmentfunction', 'contextfunction', 'clear_caches', 'is_undefined',70 'evalcontextfilter', 'evalcontextfunction', 'make_logging_undefined',71 'select_autoescape',72]737475def _patch_async():76 from jinja2.utils import have_async_gen77 if have_async_gen:78 from jinja2.asyncsupport import patch_all79 patch_all()808182_patch_async()83del _patch_async
modified:jinja2/asyncsupport.py+3 added
252 unmodified lines
253 except StopAsyncIteration:254 after = _last_iteration255 return AsyncLoopContext(async_iterator, undefined, after, length, recurse,256 depth0)257258259patch_all()
modified:jinja2/environment.py+2 added
332 unmodified lines
333 self.extensions = load_extensions(self, extensions)334335 self.enable_async = enable_async336 self.is_async = self.enable_async and have_async_gen337 if self.is_async:338 import jinja2.asyncsupport # runs patch_all() once339340 _environment_sanity_check(self)341342 def add_extension(self, extension):
936 unmodified lines