changeset 147:a95b69de2e22

Fix bug of returning _DEX_TypeList_align of dex_append_obj_list()
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 15 Aug 2011 17:44:24 +0800
parents 032877e14560
children 90e181f2a0c5
files paraspace/injection.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/paraspace/injection.py	Mon Aug 15 17:26:46 2011 +0800
+++ b/paraspace/injection.py	Mon Aug 15 17:44:24 2011 +0800
@@ -79,6 +79,7 @@
     from paraspace.dexfile import _DEX_TypeList, _DEX_TypeList_align
     from paraspace.dexfile import array_sorted
 
+    ret_obj = obj
     if isinstance(obj, _DEX_TypeList):
         wrapper = _DEX_TypeList_align()
         wrapper.value = obj
@@ -96,7 +97,10 @@
     if isinstance(array, array_sorted):
         if obj in array.items:
             idx = array.items.index(obj)
-            return array.items[idx]
+            obj = array.items[idx]
+            if isinstance(obj, _DEX_TypeList_align):
+                return obj.value
+            return obj
         pass
 
     array.items.append(obj)
@@ -107,7 +111,7 @@
         _dex_tree_set_child(dex, count_name, count + 1)
         pass
 
-    return obj
+    return ret_obj
 
 
 ## \brief Clone a composite object.