diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-04-12 08:14:11 -0700 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2010-04-12 08:14:13 -0700 |
commit | 83674a3a5564ecb1f9d2c9b2d5b1eeb3c31272ab (patch) | |
tree | cd1e77dccf1eaee4b6bdf88778340be6c617255c /lib/bb/COW.py | |
parent | d39ab776e7ceaefc8361150151cf0892dcb70d9c (diff) | |
download | bitbake-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/COW.py')
-rw-r--r-- | lib/bb/COW.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/bb/COW.py b/lib/bb/COW.py index ccb7cde3b..23a2cae2b 100644 --- a/lib/bb/COW.py +++ b/lib/bb/COW.py @@ -26,16 +26,17 @@ from __future__ import print_function import copy import types -types.ImmutableTypes = tuple([ \ - types.BooleanType, \ - types.ComplexType, \ - types.FloatType, \ - types.IntType, \ - types.LongType, \ - types.NoneType, \ - types.TupleType, \ - frozenset] + \ - list(types.StringTypes)) +ImmutableTypes = ( + types.NoneType, + bool, + complex, + float, + int, + long, + tuple, + frozenset, + basestring +) MUTABLE = "__mutable__" @@ -60,7 +61,7 @@ class COWDictMeta(COWMeta): __call__ = cow def __setitem__(cls, key, value): - if not isinstance(value, types.ImmutableTypes): + if not isinstance(value, ImmutableTypes): if not isinstance(value, COWMeta): cls.__hasmutable__ = True key += MUTABLE |