D4599: keepalive: work around slight deficiency in vcr

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sat Sep 15 03:31:28 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd6d094259d9c: keepalive: work around slight deficiency in vcr (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4599?vs=11076&id=11088

REVISION DETAIL
  https://phab.mercurial-scm.org/D4599

AFFECTED FILES
  mercurial/keepalive.py

CHANGE DETAILS

diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
--- a/mercurial/keepalive.py
+++ b/mercurial/keepalive.py
@@ -247,8 +247,10 @@
         except (socket.error, httplib.HTTPException) as err:
             raise urlerr.urlerror(err)
 
-        # if not a persistent connection, don't try to reuse it
-        if r.will_close:
+        # If not a persistent connection, don't try to reuse it. Look
+        # for this using getattr() since vcr doesn't define this
+        # attribute, and in that case always close the connection.
+        if getattr(r, r'will_close', True):
             self._cm.remove(h)
 
         if DEBUG:



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list