From 50331cbf0894bd18d8c89669297776153036bbbb Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola' Date: Wed, 10 Apr 2013 15:49:47 +0200 Subject: [PATCH] Fix issue #17675: make socket repr() provide local and remote addresses (if any). --- Lib/socket.py | 33 ++++++++++++++++++++++++++------- Lib/test/test_socket.py | 13 +++++++++++-- Misc/NEWS | 3 +++ 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/Lib/socket.py b/Lib/socket.py index da0c39a8ae..96f8ed0c7f 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -103,13 +103,32 @@ class socket(_socket.socket): self.close() def __repr__(self): - """Wrap __repr__() to reveal the real class name.""" - s = _socket.socket.__repr__(self) - if s.startswith("