Use isinstance() instead of handling TypeError. (trunk r10638)
authorZac Medico <zmedico@gentoo.org>
Tue, 10 Jun 2008 04:50:25 +0000 (04:50 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 10 Jun 2008 04:50:25 +0000 (04:50 -0000)
svn path=/main/branches/2.1.2/; revision=10639

pym/portage.py

index 932d6957eefcf3d2e0c4beba8fd0ab85a6763c11..a24f471e73315b1b601fb4ac891379f6b1510af1 100644 (file)
@@ -7479,10 +7479,8 @@ class vardbapi(dbapi):
                                pkgs = base_names.get(name_hash)
                                if pkgs is not None:
                                        for hash_value in pkgs:
-                                               try:
-                                                       if len(hash_value) != 3:
-                                                               continue
-                                               except TypeError:
+                                               if not isinstance(hash_value, tuple) or \
+                                                       len(hash_value) != 3:
                                                        continue
                                                cpv, counter, mtime = hash_value
                                                if not isinstance(cpv, basestring):