Blame SOURCES/BZ-1292087-history-hash-crash.patch

eb5f31
commit 8ae3ad9a8bb297c39bc287802b3220e497dfbbcc
eb5f31
Author: Michal Domonkos <mdomonko@redhat.com>
eb5f31
Date:   Thu Apr 14 13:36:02 2016 +0200
eb5f31
eb5f31
    Make YumHistoryRpmdbProblem objects hashable. BZ 1292087
eb5f31
    
eb5f31
    Let's use rpid for that to ensure we get the same hash value for objects
eb5f31
    that compare equal (which is iff their rpid's match, see __cmp__).
eb5f31
eb5f31
diff --git a/yum/history.py b/yum/history.py
eb5f31
index d08837c..f1295de 100644
eb5f31
--- a/yum/history.py
eb5f31
+++ b/yum/history.py
eb5f31
@@ -244,6 +244,9 @@ class YumHistoryRpmdbProblem:
eb5f31
         ret = cmp(self.rpid, other.rpid)
eb5f31
         return ret
eb5f31
 
eb5f31
+    def __hash__(self):
eb5f31
+        return hash(self.rpid)
eb5f31
+
eb5f31
     def _getProbPkgs(self):
eb5f31
         if self._loaded_P is None:
eb5f31
             self._loaded_P = sorted(self._history._old_prob_pkgs(self.rpid))