Skip to content

Commit 5bbebc8

Browse files
committed
Disable cleanup_closed on python 3.12.7+ and 3.13.1+
python/cpython#118960 has been fixed which means cleanup closed should no longer be needed
1 parent 02b34f0 commit 5bbebc8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

homeassistant/helpers/aiohttp_client.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@
4444
f"aiohttp/{aiohttp.__version__} Python/{sys.version_info[0]}.{sys.version_info[1]}"
4545
)
4646

47-
ENABLE_CLEANUP_CLOSED = not (3, 11, 1) <= sys.version_info < (3, 11, 4)
48-
# Enabling cleanup closed on python 3.11.1+ leaks memory relatively quickly
49-
# see https://github.com/aio-libs/aiohttp/issues/7252
50-
# aiohttp interacts poorly with https://github.com/python/cpython/pull/98540
51-
# The issue was fixed in 3.11.4 via https://github.com/python/cpython/pull/104485
47+
ENABLE_CLEANUP_CLOSED = sys.version_info[:3] == (3, 13, 0) or sys.version_info < (
48+
3,
49+
12,
50+
7,
51+
)
52+
# Cleanup closed is no longer needed after https://github.com/python/cpython/pull/118960
53+
# which first appeared in Python 3.12.7 and 3.13.1
5254

5355
WARN_CLOSE_MSG = "closes the Home Assistant aiohttp session"
5456

0 commit comments

Comments
 (0)