Skip to content

Commit 4278ca1

Browse files
committed
Fix 04cc0f7
mypy complains that the type annotation should be Type[PAUSED] and Type[NEED_DATA]. Sadly, the sentinels are hard to type.
1 parent a7bdffc commit 4278ca1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: h11/_connection.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def receive_data(self, data: bytes) -> None:
395395
else:
396396
self._receive_buffer_closed = True
397397

398-
def _extract_next_receive_event(self) -> Union[Event, Type[Sentinel]]:
398+
def _extract_next_receive_event(self) -> Union[Event, Type[NEED_DATA], Type[PAUSED]]:
399399
state = self.their_state
400400
# We don't pause immediately when they enter DONE, because even in
401401
# DONE state we can still process a ConnectionClosed() event. But
@@ -421,7 +421,7 @@ def _extract_next_receive_event(self) -> Union[Event, Type[Sentinel]]:
421421
event = NEED_DATA
422422
return event # type: ignore[no-any-return]
423423

424-
def next_event(self) -> Union[Event, NEED_DATA, PAUSED]:
424+
def next_event(self) -> Union[Event, Type[NEED_DATA], Type[PAUSED]]:
425425
"""Parse the next event out of our receive buffer, update our internal
426426
state, and return it.
427427

0 commit comments

Comments
 (0)