mercurial/httppeer.py
branchstable
changeset 40426 588f1e9a4d16
parent 40171 dac438b7346e
child 41315 a9b609fbe39c
--- a/mercurial/httppeer.py	Thu Oct 25 21:33:43 2018 +0800
+++ b/mercurial/httppeer.py	Mon Oct 29 16:23:42 2018 -0400
@@ -405,11 +405,15 @@
         return True
 
     def close(self):
+        try:
+            reqs, sent, recv = (self._urlopener.requestscount,
+                                self._urlopener.sentbytescount,
+                                self._urlopener.receivedbytescount)
+        except AttributeError:
+            return
         self.ui.note(_('(sent %d HTTP requests and %d bytes; '
                        'received %d bytes in responses)\n') %
-                     (self._urlopener.requestscount,
-                      self._urlopener.sentbytescount,
-                      self._urlopener.receivedbytescount))
+                     (reqs, sent, recv))
 
     # End of ipeerconnection interface.