The original code imported this in 3.12:
from aiohttp.http_websocket import ALLOWED_CLOSE_CODES, WSCloseCode
but this fails to import ALLOWED_CLOSE_CODES
in 3.13.
I’ve tried several variations but so far the only success I’ve had is hard coding it (which I do not want to do):
change:
from typing import Any, Union, cast
to:
from typing import Any, Final, Set, Union, cast
and then:
ALLOWED_CLOSE_CODES: Final[Set[int]] = {int(i) for i in WSCloseCode}
Expert advice needed (and greatly appreciated)!
Thanks!!