Author graingert
Recipients graingert
Date 2021-06-17.18:49:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org>
In-reply-to
Content
demo:

import traceback
import io

async def foo():
    yield 1
    traceback.print_stack(file=io.StringIO())
    yield 2

async def bar():
    return [chunk async for chunk in foo()]


next(bar().__await__(), None)
print("working!")


Traceback (most recent call last):
  File "/home/graingert/projects/anyio/foo.py", line 13, in <module>
    next(bar().__await__(), None)
  File "/home/graingert/projects/anyio/foo.py", line 10, in bar
    return [chunk async for chunk in foo()]
  File "/home/graingert/projects/anyio/foo.py", line -1, in <listcomp>
  File "/home/graingert/projects/anyio/foo.py", line 6, in foo
    traceback.print_stack(file=io.StringIO())
  File "/usr/lib/python3.10/traceback.py", line 203, in print_stack
    print_list(extract_stack(f, limit=limit), file=file)
  File "/usr/lib/python3.10/traceback.py", line 224, in extract_stack
    stack = StackSummary.extract(walk_stack(f), limit=limit)
  File "/usr/lib/python3.10/traceback.py", line 379, in extract
    f.line
  File "/usr/lib/python3.10/traceback.py", line 301, in line
    self._line = linecache.getline(self.filename, self.lineno).strip()
  File "/usr/lib/python3.10/linecache.py", line 31, in getline
    if 1 <= lineno <= len(lines):
TypeError: '<=' not supported between instances of 'int' and 'NoneType'
History
Date User Action Args
2021-06-17 18:49:12graingertsetrecipients: + graingert
2021-06-17 18:49:12graingertsetmessageid: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org>
2021-06-17 18:49:12graingertlinkissue44446 messages
2021-06-17 18:49:12graingertcreate