remove outdated usage of 'types'
authorantarus <antarus@gentoo.org>
Sun, 1 Apr 2007 05:03:35 +0000 (05:03 -0000)
committerantarus <antarus@gentoo.org>
Sun, 1 Apr 2007 05:03:35 +0000 (05:03 -0000)
svn path=/; revision=380

trunk/src/equery/equery
trunk/src/etcat/etcat
trunk/src/gentoolkit/helpers.py

index 8fec9fea2c79a7783b802e5e0ab945843a6d25ac..72bef594102ba44496b49c5cafb4d8083f3c2d2a 100755 (executable)
@@ -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]:
index 3b4aa8ef1525c8ce0f5741974d387531af072433..3ffa35dbbaf31ada5b8a2ef97e72e91e20873334 100755 (executable)
@@ -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]:
index fb22207a356581b6c77c0d517b460f9df429e4c1..7220a7df137bc9908f5c10032ecda7f1614ccd50 100644 (file)
@@ -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)