Skip to content

Commit d134da7

Browse files
authored
Raise EndOfStream from None in MemoryObjectReceiveStream.receive() (#889)
1 parent 2840e06 commit d134da7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/versionhistory.rst

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_.
2121
- Added the ``info`` property to ``anyio.Path`` on Python 3.14
2222
- Changed ``anyio.getaddrinfo()`` to ignore (invalid) IPv6 name resolution results when
2323
IPv6 support is disabled in Python
24+
- Changed ``EndOfStream`` raised from ``MemoryObjectReceiveStream.receive()`` to leave
25+
out the ``AttributeError`` from the exception chain which was merely an implementation
26+
detail and caused some confusion
2427
- Fixed traceback formatting growing quadratically with level of ``TaskGroup``
2528
nesting on asyncio due to exception chaining when raising ``ExceptionGroups``
2629
in ``TaskGroup.__aexit__``

src/anyio/streams/memory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async def receive(self) -> T_co:
123123
try:
124124
return receiver.item
125125
except AttributeError:
126-
raise EndOfStream
126+
raise EndOfStream from None
127127

128128
def clone(self) -> MemoryObjectReceiveStream[T_co]:
129129
"""

0 commit comments

Comments
 (0)