Skip to content

Commit be8fb97

Browse files
committed
fix typing
1 parent 631c2e8 commit be8fb97

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

pymongo/asynchronous/pool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,7 @@ def _handle_connection_error(self, error: BaseException) -> None:
10281028
# Look for errors of type AutoReconnect and add error labels if appropriate.
10291029
if self.is_sdam or type(error) not in (AutoReconnect, NetworkTimeout):
10301030
return
1031+
assert isinstance(error, AutoReconnect) # Appease type checker.
10311032
error._add_error_label("SystemOverloadedError")
10321033
error._add_error_label("RetryableError")
10331034

pymongo/synchronous/pool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,7 @@ def _handle_connection_error(self, error: BaseException) -> None:
10241024
# Look for errors of type AutoReconnect and add error labels if appropriate.
10251025
if self.is_sdam or type(error) not in (AutoReconnect, NetworkTimeout):
10261026
return
1027+
assert isinstance(error, AutoReconnect) # Appease type checker.
10271028
error._add_error_label("SystemOverloadedError")
10281029
error._add_error_label("RetryableError")
10291030

0 commit comments

Comments
 (0)