From 83674a3a5564ecb1f9d2c9b2d5b1eeb3c31272ab Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Mon, 12 Apr 2010 08:14:11 -0700 Subject: Kill unnecessary usages of the types module types.IntType -> int types.StringType -> basestring ... Also moves our ImmutableTypes tuple into our own namespace. Signed-off-by: Chris Larson --- lib/bb/fetch/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/bb/fetch') diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py index d7fb41a00..74606af02 100644 --- a/lib/bb/fetch/__init__.py +++ b/lib/bb/fetch/__init__.py @@ -126,8 +126,7 @@ def uri_replace(uri, uri_find, uri_replace, d): for i in uri_find_decoded: loc = uri_find_decoded.index(i) result_decoded[loc] = uri_decoded[loc] - import types - if type(i) == types.StringType: + if isinstance(i, basestring): if (re.match(i, uri_decoded[loc])): result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc]) if uri_find_decoded.index(i) == 2: -- cgit 1.2.3-korg