summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/COW.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/COW.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/COW.py')
-rw-r--r--bitbake/lib/bb/COW.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/bitbake/lib/bb/COW.py b/bitbake/lib/bb/COW.py
index ccb7cde3ba..23a2cae2b4 100644
--- a/bitbake/lib/bb/COW.py
+++ b/bitbake/lib/bb/COW.py
@@ -26,16 +26,17 @@
26from __future__ import print_function 26from __future__ import print_function
27import copy 27import copy
28import types 28import types
29types.ImmutableTypes = tuple([ \ 29ImmutableTypes = (
30 types.BooleanType, \ 30 types.NoneType,
31 types.ComplexType, \ 31 bool,
32 types.FloatType, \ 32 complex,
33 types.IntType, \ 33 float,
34 types.LongType, \ 34 int,
35 types.NoneType, \ 35 long,
36 types.TupleType, \ 36 tuple,
37 frozenset] + \ 37 frozenset,
38 list(types.StringTypes)) 38 basestring
39)
39 40
40MUTABLE = "__mutable__" 41MUTABLE = "__mutable__"
41 42
@@ -60,7 +61,7 @@ class COWDictMeta(COWMeta):
60 __call__ = cow 61 __call__ = cow
61 62
62 def __setitem__(cls, key, value): 63 def __setitem__(cls, key, value):
63 if not isinstance(value, types.ImmutableTypes): 64 if not isinstance(value, ImmutableTypes):
64 if not isinstance(value, COWMeta): 65 if not isinstance(value, COWMeta):
65 cls.__hasmutable__ = True 66 cls.__hasmutable__ = True
66 key += MUTABLE 67 key += MUTABLE