summaryrefslogtreecommitdiffstats
path: root/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-04-12 08:14:11 -0700
committerChris Larson <chris_larson@mentor.com>2010-04-12 08:14:13 -0700
commit83674a3a5564ecb1f9d2c9b2d5b1eeb3c31272ab (patch)
treecd1e77dccf1eaee4b6bdf88778340be6c617255c /lib/bb/data_smart.py
parentd39ab776e7ceaefc8361150151cf0892dcb70d9c (diff)
downloadbitbake-83674a3a5564ecb1f9d2c9b2d5b1eeb3c31272ab.tar.gz
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 <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r--lib/bb/data_smart.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 1704ed631..9436023b3 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -28,7 +28,7 @@ BitBake build tools.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
-import copy, re, sys, types
+import copy, re, sys
import bb
from bb import utils
from bb.COW import COWDictBase
@@ -66,10 +66,10 @@ class DataSmart:
code = match.group()[3:-1]
codeobj = compile(code.strip(), varname or "<expansion>", "eval")
s = utils.better_eval(codeobj, {"d": self})
- if isinstance(s, types.IntType): s = str(s)
+ if isinstance(s, int): s = str(s)
return s
- if not isinstance(s, types.StringType): # sanity check
+ if not isinstance(s, basestring): # sanity check
return s
if varname and varname in self.expand_cache:
@@ -81,7 +81,7 @@ class DataSmart:
s = __expand_var_regexp__.sub(var_sub, s)
s = __expand_python_regexp__.sub(python_sub, s)
if s == olds: break
- if not isinstance(s, types.StringType): # sanity check
+ if not isinstance(s, basestring): # sanity check
bb.msg.error(bb.msg.domain.Data, 'expansion of %s returned non-string %s' % (olds, s))
except KeyboardInterrupt:
raise