diff options
| author | Chris Larson <chris_larson@mentor.com> | 2010-04-12 08:14:11 -0700 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:33 +0100 |
| commit | 22a21799059b156d8858cbf32acb7c2aefb9a23b (patch) | |
| tree | 1e0e83c86fe04e30576ddfb34577940596f8d809 /bitbake/lib/bb/COW.py | |
| parent | 1180bab54e2879401f3586c91a48174191a1ee8b (diff) | |
| download | poky-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.py | 23 |
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 @@ | |||
| 26 | from __future__ import print_function | 26 | from __future__ import print_function |
| 27 | import copy | 27 | import copy |
| 28 | import types | 28 | import types |
| 29 | types.ImmutableTypes = tuple([ \ | 29 | ImmutableTypes = ( |
| 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 | ||
| 40 | MUTABLE = "__mutable__" | 41 | MUTABLE = "__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 |
