Skip to content

Commit d5bbb80

Browse files
authored
[PR #9710/b40265e backport][3.11] Remove redundant protocol.should_close check in Connection._release (#9712)
1 parent 76f7722 commit d5bbb80

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

aiohttp/connector.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ def release(self) -> None:
186186
self._notify_release()
187187

188188
if self._protocol is not None:
189-
self._connector._release(
190-
self._key, self._protocol, should_close=self._protocol.should_close
191-
)
189+
self._connector._release(self._key, self._protocol)
192190
self._protocol = None
193191

194192
@property

tests/test_client_connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def test_release(connector, key, protocol, loop) -> None:
112112
conn.release()
113113
assert not protocol.transport.close.called
114114
assert conn._protocol is None
115-
connector._release.assert_called_with(key, protocol, should_close=False)
115+
connector._release.assert_called_with(key, protocol)
116116
assert conn.closed
117117

118118

@@ -123,7 +123,7 @@ def test_release_proto_should_close(connector, key, protocol, loop) -> None:
123123
conn.release()
124124
assert not protocol.transport.close.called
125125
assert conn._protocol is None
126-
connector._release.assert_called_with(key, protocol, should_close=True)
126+
connector._release.assert_called_with(key, protocol)
127127
assert conn.closed
128128

129129

0 commit comments

Comments
 (0)