Fix Python code when _bestPackageFromList returns None.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 8 Nov 2011 14:40:18 +0000 (14:40 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 8 Nov 2011 14:40:18 +0000 (14:40 +0000)
Yet Another Bug caused by lack of strong typing and nullable types in
this sad excuse for a programming language.

src/febootstrap_yum_rpm.ml

index bfda11e..1def619 100644 (file)
@@ -78,7 +78,7 @@ while not stable:
             for r in pkg.requires:
                 ps = yb.whatProvides (r[0], r[1], r[2])
                 best = yb._bestPackageFromList (ps.returnPackages ())
-                if best.name != pkg.name:
+                if best and best.name != pkg.name:
                     deps[pkg].append (best)
                     if not deps.has_key (best):
                         deps[best] = False