summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-04-12 08:14:11 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-02 15:41:33 +0100
commit22a21799059b156d8858cbf32acb7c2aefb9a23b (patch)
tree1e0e83c86fe04e30576ddfb34577940596f8d809 /bitbake/lib/bb/data_smart.py
parent1180bab54e2879401f3586c91a48174191a1ee8b (diff)
downloadpoky-22a21799059b156d8858cbf32acb7c2aefb9a23b.tar.gz
Kill unnecessary usages of the types module
types.IntType -> int types.StringType -> basestring ... Also moves our ImmutableTypes tuple into our own namespace. (Bitbake rev: 83674a3a5564ecb1f9d2c9b2d5b1eeb3c31272ab) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r--bitbake/lib/bb/data_smart.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 1704ed631c..9436023b30 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -28,7 +28,7 @@ BitBake build tools.
28# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 28# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29# Based on functions from the base bb module, Copyright 2003 Holger Schurig 29# Based on functions from the base bb module, Copyright 2003 Holger Schurig
30 30
31import copy, re, sys, types 31import copy, re, sys
32import bb 32import bb
33from bb import utils 33from bb import utils
34from bb.COW import COWDictBase 34from bb.COW import COWDictBase
@@ -66,10 +66,10 @@ class DataSmart:
66 code = match.group()[3:-1] 66 code = match.group()[3:-1]
67 codeobj = compile(code.strip(), varname or "<expansion>", "eval") 67 codeobj = compile(code.strip(), varname or "<expansion>", "eval")
68 s = utils.better_eval(codeobj, {"d": self}) 68 s = utils.better_eval(codeobj, {"d": self})
69 if isinstance(s, types.IntType): s = str(s) 69 if isinstance(s, int): s = str(s)
70 return s 70 return s
71 71
72 if not isinstance(s, types.StringType): # sanity check 72 if not isinstance(s, basestring): # sanity check
73 return s 73 return s
74 74
75 if varname and varname in self.expand_cache: 75 if varname and varname in self.expand_cache:
@@ -81,7 +81,7 @@ class DataSmart:
81 s = __expand_var_regexp__.sub(var_sub, s) 81 s = __expand_var_regexp__.sub(var_sub, s)
82 s = __expand_python_regexp__.sub(python_sub, s) 82 s = __expand_python_regexp__.sub(python_sub, s)
83 if s == olds: break 83 if s == olds: break
84 if not isinstance(s, types.StringType): # sanity check 84 if not isinstance(s, basestring): # sanity check
85 bb.msg.error(bb.msg.domain.Data, 'expansion of %s returned non-string %s' % (olds, s)) 85 bb.msg.error(bb.msg.domain.Data, 'expansion of %s returned non-string %s' % (olds, s))
86 except KeyboardInterrupt: 86 except KeyboardInterrupt:
87 raise 87 raise