Skip to content

Commit 73d41e1

Browse files
committed
Address review
1 parent e08da84 commit 73d41e1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pymongo/pool_shared.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,11 @@ async def _async_create_connection(address: _Address, options: PoolOptions) -> s
253253
return sock
254254
except asyncio.TimeoutError as e:
255255
sock.close()
256-
raise socket.timeout("timed out") from e
256+
err = socket.timeout("timed out")
257+
err.__cause__ = e
257258
except OSError as e:
258259
sock.close()
259-
err = e
260+
err = e # type: ignore[assignment]
260261

261262
if err is not None:
262263
raise err

test/asynchronous/test_async_loop_unblocked.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ async def background_task():
5151

5252
self.assertLessEqual(
5353
sorted(latencies, reverse=True)[0],
54-
0.2,
54+
1.0,
5555
"Background task was blocked from running",
5656
)

0 commit comments

Comments
 (0)