stablerange: be more cautious when deleting the sql connection
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 21 Dec 2017 04:35:40 +0100
changeset 3348 895e16385a4f
parent 3347 ab5172ba3c81
child 3349 0539070016b0
stablerange: be more cautious when deleting the sql connection This triggered some crash in further development. This also match what is done elsewhere with this attribute.
hgext3rd/evolve/stablerangecache.py
--- a/hgext3rd/evolve/stablerangecache.py	Thu Dec 21 03:42:54 2017 +0100
+++ b/hgext3rd/evolve/stablerangecache.py	Thu Dec 21 04:35:40 2017 +0100
@@ -267,7 +267,8 @@
 
     def clear(self, reset=False):
         super(stablerangesql, self).clear(reset=reset)
-        del self._con
+        if '_con' in vars(self):
+            del self._con
         self._subrangescache.clear()
 
     def load(self, repo):