##// END OF EJS Templates
keepalive: add `__repr__()` to the HTTPConnection class to ease debugging...
Matt Harbison -
r50437:76fbb1b6 stable
parent child Browse files
Show More
@@ -702,6 +702,17 b' class HTTPConnection(httplib.HTTPConnect'
702 self.sentbytescount = 0
702 self.sentbytescount = 0
703 self.receivedbytescount = 0
703 self.receivedbytescount = 0
704
704
705 def __repr__(self):
706 base = super(HTTPConnection, self).__repr__()
707 local = "(unconnected)"
708 s = self.sock
709 if s:
710 try:
711 local = "%s:%d" % s.getsockname()
712 except OSError:
713 pass # Likely not connected
714 return "<%s: %s <--> %s:%d>" % (base, local, self.host, self.port)
715
705
716
706 #########################################################################
717 #########################################################################
707 ##### TEST FUNCTIONS
718 ##### TEST FUNCTIONS
General Comments 0
You need to be logged in to leave comments. Login now