Skip to content

Commit 40e2bf0

Browse files
.
1 parent 6f1d833 commit 40e2bf0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

sentry_sdk/integrations/anthropic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def setup_once() -> None:
123123

124124
# Before https://github.com/anthropics/anthropic-sdk-python/commit/b1a1c0354a9aca450a7d512fdbdeb59c0ead688a
125125
# MessageStream inherits from Stream, so patching Stream is sufficient on these versions.
126-
if version >= (0, 26, 2):
126+
if version is not None and version >= (0, 26, 2):
127127
MessageStream.__iter__ = _wrap_message_stream_iter(MessageStream.__iter__)
128128
MessageStream.__next__ = _wrap_message_stream_next(MessageStream.__next__)
129129
MessageStream.close = _wrap_message_stream_close(MessageStream.close)

tests/integrations/anthropic/test_anthropic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,7 @@ def test_stream_messages_iterator_methods(
821821
next(stream)
822822
next(stream)
823823
list(islice(stream, 1))
824+
next(stream)
824825
# New versions add TextEvent, so consume one more event.
825826
if TextEvent is not None and isinstance(next(stream), TextEvent):
826827
next(stream)

0 commit comments

Comments
 (0)