From: Zac Medico Date: Tue, 10 Jun 2008 04:50:25 +0000 (-0000) Subject: Use isinstance() instead of handling TypeError. (trunk r10638) X-Git-Tag: v2.1.5.5~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d20794abae70afe01420fa416af056a2ad7db035;p=portage.git Use isinstance() instead of handling TypeError. (trunk r10638) svn path=/main/branches/2.1.2/; revision=10639 --- diff --git a/pym/portage.py b/pym/portage.py index 932d6957e..a24f471e7 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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):