From a29dd312ba6935871c9652efa317eef329e487de Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 10 Jun 2008 04:48:51 +0000 Subject: Use isinstance() instead of handling TypeError. svn path=/main/trunk/; revision=10638 --- pym/portage/dbapi/vartree.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'pym') 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): -- cgit v1.2.3-1-g7c22