# HG changeset patch # User Pierre-Yves David # Date 1508847434 -7200 # Node ID ca66508797265166055dd951eb5b8c45e04c7d2a # Parent 6f10c94a211499e97e551fa6170a50942889cf77 compat: drop 'lru.get' work-around for 3.9 We no longer support this version. diff -r 6f10c94a2114 -r ca6650879726 hgext3rd/evolve/stablerange.py --- a/hgext3rd/evolve/stablerange.py Tue Oct 24 14:13:57 2017 +0200 +++ b/hgext3rd/evolve/stablerange.py Tue Oct 24 14:17:14 2017 +0200 @@ -395,13 +395,7 @@ # data about the merge. But I'm not sure this function will be even # call for the general case. - # Lrudict.get in hg-3.9 returns the lrunode instead of the - # value, use __getitem__ instead and catch the exception directly - try: - allrevs = self._stablesortcache[headrev] - except KeyError: - allrevs = None - + allrevs = self._stablesortcache.get(headrev) if allrevs is None: allrevs = self._getrevsfrommerge(repo, headrev) if allrevs is None: @@ -450,11 +444,8 @@ self._stablesortprepared[merge] = (sortedrevs, len(sortedrevs)) def _getrevsfrommerge(self, repo, merge): - # Lrudict.get in hg-3.9 returns the lrunode instead of the - # value, use __getitem__ instead and catch the exception directly - try: - prepared = self._stablesortprepared[merge] - except KeyError: + prepared = self._stablesortprepared.get(merge) + if prepared is None: return None mergedepth = self.depthrev(repo, merge)