[meld] vc.bzr: Fix py3k None ordering (bgo#788487)



commit 2fa768472cdd156a490e09d0f2a32318672548d1
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Oct 21 08:38:29 2017 +1000

    vc.bzr: Fix py3k None ordering (bgo#788487)
    
    This code uses None to indicate status flags that we don't care about.
    We don't handle the more structured status of Bazaar, and instead just
    chuck everything into a set and then have a few membership tests for
    things we care about.
    
    In Python 2, having Nones in that set was fine and they'd just never
    match anything. That aspect is fine in Python 3 as well, but because we
    use max() to figure out the "most meaningful" status for an entry,
    Python 3 complains because of None ordering handling. Since we don't
    ever actually care about the None entries here, the easiest fix is to
    just remove that status.

 meld/vc/bzr.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/meld/vc/bzr.py b/meld/vc/bzr.py
index 4c302e4..fb175e7 100644
--- a/meld/vc/bzr.py
+++ b/meld/vc/bzr.py
@@ -172,7 +172,7 @@ class Vc(_vc.Vc):
             state2 = self.state_2_map.get(state_string[1])
             state3 = self.state_3_map.get(state_string[2])
 
-            states = {state1, state2, state3}
+            states = {state1, state2, state3} - {None}
 
             if _vc.STATE_CONFLICT in states:
                 real_path_match = re.search(self.CONFLICT_RE, name)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]