From: Zac Medico Date: Tue, 10 Jun 2008 04:48:51 +0000 (-0000) Subject: Use isinstance() instead of handling TypeError. X-Git-Tag: v2.2_rc1~47 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a29dd312ba6935871c9652efa317eef329e487de;p=portage.git Use isinstance() instead of handling TypeError. svn path=/main/trunk/; revision=10638 --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 190157b88..f57555483 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -996,10 +996,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):