diff options
author | 2011-12-30 12:52:08 -0500 | |
---|---|---|
committer | 2011-12-30 12:52:22 -0500 | |
commit | 5b1fd173f1709b0eefc4fd6276756e914837f156 (patch) | |
tree | 21463c8c9504b683e0585e29741d6acd1ad75055 | |
parent | Forward-compat WEB_CATEGORY variable (diff) | |
download | webapp-config-5b1fd173f1709b0eefc4fd6276756e914837f156.tar.gz webapp-config-5b1fd173f1709b0eefc4fd6276756e914837f156.tar.bz2 webapp-config-5b1fd173f1709b0eefc4fd6276756e914837f156.zip |
Use isinstance() for compatibility with Python 3.
Reported-By: Arfrever <arfrever@gentoo.org>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r-- | WebappConfig/permissions.py | 6 | ||||
-rw-r--r-- | WebappConfig/wrapper.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/WebappConfig/permissions.py b/WebappConfig/permissions.py index 13b2c3f..0bf99ea 100644 --- a/WebappConfig/permissions.py +++ b/WebappConfig/permissions.py @@ -25,7 +25,7 @@ __version__ = "$Id: permissions.py 129 2005-11-06 12:46:31Z wrobel $" # Dependencies # ------------------------------------------------------------------------ -import re, types, grp, pwd +import re, grp, pwd # ======================================================================== # Permission Helper @@ -203,7 +203,7 @@ def get_group(group): ngroup = -1 # Can we transform the value to an integer? - if type(group) != types.IntType: + if not isinstance(group, int): try: ngroup = int(group) except ValueError: @@ -251,7 +251,7 @@ def get_user(user): nuser = -1 # Can we transform the value to an integer? - if type(user) != types.IntType: + if not isinstance(user, int): try: nuser = int(user) except ValueError: diff --git a/WebappConfig/wrapper.py b/WebappConfig/wrapper.py index e0d1e87..fd4b010 100644 --- a/WebappConfig/wrapper.py +++ b/WebappConfig/wrapper.py @@ -26,7 +26,7 @@ __version__ = "$Id: wrapper.py 283 2006-04-20 22:53:04Z wrobel $" # Dependencies # ------------------------------------------------------------------------ -import os, types, string +import os, string from WebappConfig.debug import OUT @@ -133,7 +133,7 @@ def package_installed(full_name, pm): t = portage.db[portage.root]["vartree"].dbapi.match(full_name) # catch the "ambiguous package" Exception except ValueError as e: - if type(e[0]) == types.ListType: + if isinstance(e[0], list): t = [] for cp in e[0]: t += portage.db[portage.root]["vartree"].dbapi.match(cp) |