From: antarus Date: Sun, 1 Apr 2007 05:03:35 +0000 (-0000) Subject: remove outdated usage of 'types' X-Git-Tag: gentoolkit-0.2.4.3~133 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b268435e0b35ece1c8c1b3d91c8371bf2ee8980b;p=gentoolkit.git remove outdated usage of 'types' svn path=/; revision=380 --- diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index 8fec9fe..72bef59 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -17,7 +17,6 @@ import os import re import sys import time -import types # portage (output module) and gentoolkit need special path modifications sys.path.insert(0, "/usr/lib/portage/pym") @@ -1770,7 +1769,7 @@ if __name__ == "__main__": print_error(str(e)) sys.exit(2) except ValueError, e: - if e and type(e[0]) == types.ListType: + if isinstance(e[0], list): print_error("Ambiguous package name " + pp.emph("\"" + local_opts[0] + "\"")) print_error("Please use one of the following long names:") for p in e[0]: diff --git a/trunk/src/etcat/etcat b/trunk/src/etcat/etcat index 3b4aa8e..3ffa35d 100755 --- a/trunk/src/etcat/etcat +++ b/trunk/src/etcat/etcat @@ -84,7 +84,6 @@ import os import sys import re import pprint -import types import getopt import glob @@ -664,7 +663,7 @@ def main(): print red("!!!"), e sys.exit(2) except ValueError, e: - if type(e[0]) == types.ListType: + if isinstance(e[0],list): print red("!!!"), "Ambiguous package name \"%s\"" % query print red("!!!"), "Please use one of the following long names:" for p in e[0]: diff --git a/trunk/src/gentoolkit/helpers.py b/trunk/src/gentoolkit/helpers.py index fb22207..7220a7d 100644 --- a/trunk/src/gentoolkit/helpers.py +++ b/trunk/src/gentoolkit/helpers.py @@ -23,7 +23,7 @@ def find_packages(search_key, masked=False): t += portage.db["/"]["vartree"].dbapi.match(search_key) # catch the "amgigous package" Exception except ValueError, e: - if type(e[0]) == types.ListType: + if isinstance(e[0],list): t = [] for cp in e[0]: if masked: @@ -45,7 +45,7 @@ def find_installed_packages(search_key, masked=False): t = portage.db["/"]["vartree"].dbapi.match(search_key) # catch the "amgigous package" Exception except ValueError, e: - if type(e[0]) == types.ListType: + if isinstance(e[0],list): t = [] for cp in e[0]: t += portage.db["/"]["vartree"].dbapi.match(cp)