From efab08fc9ffbecdd91ce598fadcb13abcfb6755a Mon Sep 17 00:00:00 2001 From: Moritz Lell Date: Wed, 30 Oct 2019 19:51:17 +0100 Subject: [PATCH] Python 2/3 compatible treatment of max(n, None) Python 3 does no longer allow comparisons of different types. Therefore, explicitly convert f.checked_runid to a number that's always smaller than `f.changed_runid` --- redo/deps.py | 2 +- redo/state.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/redo/deps.py b/redo/deps.py index 0ce53d3..bc2909c 100644 --- a/redo/deps.py +++ b/redo/deps.py @@ -95,7 +95,7 @@ def isdirty(f, depth, max_changed, elif mode == 'm': sub = isdirty(f2, depth=depth + ' ', max_changed=max(f.changed_runid, - f.checked_runid), + f.checked_runid or 0), already_checked=already_checked, is_checked=is_checked, set_checked=set_checked, diff --git a/redo/state.py b/redo/state.py index 37b1856..667a3d8 100644 --- a/redo/state.py +++ b/redo/state.py @@ -278,7 +278,8 @@ class File(object): (self.id, self.name, self.is_generated, self.is_override, self.checked_runid, self.changed_runid, self.failed_runid, self.stamp, self.csum) = cols - if self.name == ALWAYS and self.changed_runid < env.v.RUNID: + if self.name == ALWAYS and ( + self.changed_runid is None or self.changed_runid < env.v.RUNID): self.changed_runid = env.v.RUNID def __init__(self, fid=None, name=None, cols=None, allow_add=True):