diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-08-25 12:54:32 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-08-25 13:03:33 +0300 |
commit | 4a64a813e1d34e732f35d8a65147974f76395a6f (patch) | |
tree | a8da0dede5213f85e45b95047cfbdcf5427cf0b7 /contrib/python/Twisted/py3/twisted/web/_flatten.py | |
parent | e9bbee265681b79a9ef9795bdc84cf6996f9cfec (diff) | |
download | ydb-4a64a813e1d34e732f35d8a65147974f76395a6f.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/python/Twisted/py3/twisted/web/_flatten.py')
-rw-r--r-- | contrib/python/Twisted/py3/twisted/web/_flatten.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/python/Twisted/py3/twisted/web/_flatten.py b/contrib/python/Twisted/py3/twisted/web/_flatten.py index 87a8bf2dfb..12691b87fa 100644 --- a/contrib/python/Twisted/py3/twisted/web/_flatten.py +++ b/contrib/python/Twisted/py3/twisted/web/_flatten.py @@ -418,7 +418,6 @@ async def _flattenTree( while stack: try: - frame = stack[-1].gi_frame element = next(stack[-1]) if isinstance(element, Deferred): # Before suspending flattening for an unknown amount of time, @@ -428,11 +427,11 @@ async def _flattenTree( except StopIteration: stack.pop() except Exception as e: - stack.pop() roots = [] for generator in stack: - roots.append(generator.gi_frame.f_locals["root"]) - roots.append(frame.f_locals["root"]) + if generator.gi_frame is not None: + roots.append(generator.gi_frame.f_locals["root"]) + stack.pop() raise FlattenerError(e, roots, extract_tb(exc_info()[2])) else: stack.append(element) |