diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-29 10:38:18 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-29 10:38:18 (GMT) |
commit | e033e06db077d5abcb4bc3729d03f8a4a09b2486 (patch) | |
tree | 04445ffa669d4d0df240d680249c7d7a7f661bd4 /Lib/socket.py | |
parent | 9cbdd75ec5deda8f55edd7caab42dff65d009da2 (diff) | |
download | cpython-e033e06db077d5abcb4bc3729d03f8a4a09b2486.zip cpython-e033e06db077d5abcb4bc3729d03f8a4a09b2486.tar.gz cpython-e033e06db077d5abcb4bc3729d03f8a4a09b2486.tar.bz2 |
Issue #10093: ResourceWarnings are now issued when files and sockets are
deallocated without explicit closing. These warnings are silenced by
default, except in pydebug mode.
Diffstat (limited to 'Lib/socket.py')
-rw-r--r-- | Lib/socket.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index 6af1964..2dc9736 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -108,7 +108,7 @@ class socket(_socket.socket): if s.startswith("<socket object"): s = "<%s.%s%s%s" % (self.__class__.__module__, self.__class__.__name__, - (self._closed and " [closed] ") or "", + getattr(self, '_closed', False) and " [closed] " or "", s[7:]) return s |