From 465e60e654732b3a0b726d1fd82950fc982fcba2 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 25 Jul 2014 23:36:00 +0300 Subject: Issue #22033: Reprs of most Python implemened classes now contain actual class name instead of hardcoded one. --- Lib/xmlrpc/client.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Lib/xmlrpc/client.py') diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index d46f32c8df..3a1435d611 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -207,8 +207,8 @@ class ProtocolError(Error): self.headers = headers def __repr__(self): return ( - "" % - (self.url, self.errcode, self.errmsg) + "<%s for %s: %s %s>" % + (self.__class__.__name__, self.url, self.errcode, self.errmsg) ) ## @@ -236,7 +236,8 @@ class Fault(Error): self.faultCode = faultCode self.faultString = faultString def __repr__(self): - return "" % (self.faultCode, self.faultString) + return "<%s %s: %r>" % (self.__class__.__name__, + self.faultCode, self.faultString) # -------------------------------------------------------------------- # Special values @@ -354,7 +355,7 @@ class DateTime: return self.value def __repr__(self): - return "" % (self.value, id(self)) + return "<%s %r at %#x>" % (self.__class__.__name__, self.value, id(self)) def decode(self, data): self.value = str(data).strip() @@ -846,7 +847,7 @@ class MultiCall: self.__call_list = [] def __repr__(self): - return "" % id(self) + return "<%s at %#x>" % (self.__class__.__name__, id(self)) __str__ = __repr__ @@ -1426,8 +1427,8 @@ class ServerProxy: def __repr__(self): return ( - "" % - (self.__host, self.__handler) + "<%s for %s%s>" % + (self.__class__.__name__, self.__host, self.__handler) ) __str__ = __repr__ -- cgit v1.2.1