From d20794abae70afe01420fa416af056a2ad7db035 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 10 Jun 2008 04:50:25 +0000 Subject: [PATCH] Use isinstance() instead of handling TypeError. (trunk r10638) svn path=/main/branches/2.1.2/; revision=10639 --- pym/portage.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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): -- 2.26.2