changeset 4750:d9d55e34943c

py3: avoid comparing int and None
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 11 Jul 2019 15:30:40 -0700
parents cdafbd01d0bf
children 8a73a8df63b6
files hgext3rd/evolve/stablerangecache.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/stablerangecache.py	Thu Jul 11 21:48:37 2019 -0700
+++ b/hgext3rd/evolve/stablerangecache.py	Thu Jul 11 15:30:40 2019 -0700
@@ -208,7 +208,11 @@
         # 1) check the in memory cache
         # 2) check the sqlcaches (and warm in memory cache we want we find)
         cache = self._subrangescache
-        if rangeid not in cache and rangeid[0] <= self._ondisktiprev and self._con is not None:
+        if (rangeid not in cache
+            and self._ondisktiprev is not None
+            and rangeid[0] <= self._ondisktiprev
+            and self._con is not None):
+
             value = None
             try:
                 result = self._con.execute(_queryrange, rangeid).fetchone()