1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 12:49:46 +00:00

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>
This commit is contained in:
Chris Larson
2010-04-12 08:14:11 -07:00
committed by Richard Purdie
parent 1180bab54e
commit 22a2179905
5 changed files with 22 additions and 22 deletions
+4 -4
View File
@@ -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