[pypy-commit] pypy default: fix and don"t compare pointers by is

fijal noreply at buildbot.pypy.org
Sat Jul 23 12:01:47 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r45896:8c9bfd29cb30
Date: 2011-07-23 12:01 +0200
http://bitbucket.org/pypy/pypy/changeset/8c9bfd29cb30/

Log:	fix and don"t compare pointers by is

diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -248,8 +248,8 @@
             if isinstance(w_value, BaseArray):
                 # for now we just copy if setting part of an array from 
                 # part of itself. can be improved.
-                if concrete.get_root_storage() is \
-                                    w_value.get_concrete().get_root_storage():
+                if (concrete.get_root_storage() ==
+                    w_value.get_concrete().get_root_storage()):
                     w_value = new_numarray(space, w_value)
             else:
                 w_value = convert_to_array(space, w_value)
@@ -453,7 +453,7 @@
         self.size = slice_length
 
     def get_root_storage(self):
-        self.parent.storage
+        return self.parent.storage
 
     def find_size(self):
         return self.size


More information about the pypy-commit mailing list