Fix introspection code in fetch() so that it works correctly when myuris is v2.2_rc58
authorZac Medico <zmedico@gentoo.org>
Thu, 10 Dec 2009 05:48:00 +0000 (05:48 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 10 Dec 2009 05:48:00 +0000 (05:48 -0000)
an OrderedDict instance. This fixes broken fetching for some packages.

svn path=/main/trunk/; revision=15019

pym/portage/__init__.py

index 7ed9df4a6040f6a5990c75c4871b3d10614692cb..c13a7149b6f2fd57739da5eeb68afa29250a9d0c 100644 (file)
@@ -4511,7 +4511,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                locations = mymirrors
 
        file_uri_tuples = []
-       if isinstance(myuris, dict):
+       # Check for 'items' attribute since OrderedDict is not a dict.
+       if hasattr(myuris, 'items'):
                for myfile, uri_set in myuris.items():
                        for myuri in uri_set:
                                file_uri_tuples.append((myfile, myuri))