Skip to content

Commit a16f262

Browse files
remove warning
1 parent 385390a commit a16f262

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Lib/asyncio/streams.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import collections
66
import socket
77
import sys
8-
import warnings
98
import weakref
109

1110
if hasattr(socket, 'AF_UNIX'):
@@ -393,10 +392,9 @@ async def start_tls(self, sslcontext, *,
393392
self._transport = new_transport
394393
protocol._replace_writer(self)
395394

396-
def __del__(self, warnings=warnings):
395+
def __del__(self):
397396
if not self._transport.is_closing():
398397
self.close()
399-
warnings.warn(f"unclosed {self!r}", ResourceWarning)
400398

401399

402400
class StreamReader:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Raise :exc:`ResourceWarning` when :class:`asyncio.StreamWriter` is not closed leading to memory leaks. Patch by Kumar Aditya.
1+
Close :class:`asyncio.StreamWriter` when it is not closed by application leading to memory leaks. Patch by Kumar Aditya.

0 commit comments

Comments
 (0)