import asyncio
import gc
import objgraph
import weakref
async def amain():
exc = None
try:
await asyncio.open_connection(
host="localhost", port=8080, happy_eyeballs_delay=0.25
)
except* OSError as excs:
exc = excs.exceptions[0]
assert exc is not None
print(gc.get_referrers(exc))
asyncio.run(amain())
[[ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 8080)")], [ConnectionRefusedError(111, "Connect call failed ('127.0.0.1', 8080)")]]