Commit 4a741af
committed
Close the resource only when protocol_factory() fails
On the proactor, _make_*_transport() takes ownership of the socket/pipe and
starts I/O before it can raise, so closing it in connect_*()/create_*()
double-manages it (broke test_windows_events). Close only when
protocol_factory() raises, before any transport exists.1 parent c643223 commit 4a741af
2 files changed
Lines changed: 12 additions & 12 deletions
File tree
- Lib/asyncio
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1499 | 1499 | | |
1500 | 1500 | | |
1501 | 1501 | | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | 1502 | | |
1506 | | - | |
| 1503 | + | |
1507 | 1504 | | |
1508 | 1505 | | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
1509 | 1509 | | |
1510 | 1510 | | |
1511 | 1511 | | |
| |||
1721 | 1721 | | |
1722 | 1722 | | |
1723 | 1723 | | |
1724 | | - | |
1725 | | - | |
1726 | 1724 | | |
1727 | | - | |
| 1725 | + | |
1728 | 1726 | | |
1729 | 1727 | | |
| 1728 | + | |
| 1729 | + | |
1730 | 1730 | | |
1731 | 1731 | | |
1732 | 1732 | | |
| |||
1742 | 1742 | | |
1743 | 1743 | | |
1744 | 1744 | | |
1745 | | - | |
1746 | | - | |
1747 | 1745 | | |
1748 | | - | |
| 1746 | + | |
1749 | 1747 | | |
1750 | 1748 | | |
| 1749 | + | |
| 1750 | + | |
1751 | 1751 | | |
1752 | 1752 | | |
1753 | 1753 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
0 commit comments