diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-08-15 14:22:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-15 14:22:20 -0500 |
commit | 63d30baee2535f03d55a10819ea1e56165d4c030 (patch) | |
tree | 9ec805147b5cbecdf8b4bc5e7a5264a3148ac532 /numpy/ma/core.py | |
parent | 256103a9313a59a0a0762175574ed5acb5290520 (diff) | |
parent | 76eff9ca4648e96ba1f560e83f40383f68805493 (diff) | |
download | numpy-63d30baee2535f03d55a10819ea1e56165d4c030.tar.gz |
Merge pull request #7912 from mattip/pypy-fixes2
ENH: skip or avoid gc/objectmodel differences btwn pypy and cpython
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r-- | numpy/ma/core.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 37836a0a0..b01656ec9 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -3279,12 +3279,13 @@ class MaskedArray(ndarray): # We want to remove the unshare logic from this place in the # future. Note that _sharedmask has lots of false positives. if not self._isfield: + notthree = getattr(sys, 'getrefcount', False) and (sys.getrefcount(_mask) != 3) if self._sharedmask and not ( # If no one else holds a reference (we have two # references (_mask and self._mask) -- add one for # getrefcount) and the array owns its own data # copying the mask should do nothing. - (sys.getrefcount(_mask) == 3) and _mask.flags.owndata): + (not notthree) and _mask.flags.owndata): # 2016.01.15 -- v1.11.0 warnings.warn( "setting an item on a masked array which has a shared " |