# HG changeset patch # User Mads Kiilerich # Date 2019-12-26 04:05:14 # Node ID 85e34d874a1e75d6355bc3ccef7f0c2914304351 # Parent d9d03f138cc386f9e45280f53ef839f6160e242a lib: avoid comparing ordering with None Fails in py3. diff --git a/kallithea/lib/celerylib/tasks.py b/kallithea/lib/celerylib/tasks.py --- a/kallithea/lib/celerylib/tasks.py +++ b/kallithea/lib/celerylib/tasks.py @@ -124,7 +124,7 @@ def get_commits_stats(repo_name, ts_min_ log.debug('starting parsing %s', parse_limit) - last_rev = last_rev + 1 if last_rev >= 0 else 0 + last_rev = last_rev + 1 if last_rev and last_rev >= 0 else 0 log.debug('Getting revisions from %s to %s', last_rev, last_rev + parse_limit ) @@ -142,8 +142,7 @@ def get_commits_stats(repo_name, ts_min_ except ValueError: time_pos = None - if time_pos >= 0 and time_pos is not None: - + if time_pos is not None and time_pos >= 0: datadict = \ co_day_auth_aggr[akc(cs.author)]['data'][time_pos]