summaryrefslogtreecommitdiff
path: root/numpy/core/memmap.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/memmap.py')
-rw-r--r--numpy/core/memmap.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py
index d3dbd09fb..c10ca15c9 100644
--- a/numpy/core/memmap.py
+++ b/numpy/core/memmap.py
@@ -77,9 +77,13 @@ class memmap(ndarray):
return self
def __array_finalize__(self, obj):
- if obj is not None and not isinstance(obj, memmap):
- raise ValueError, "Cannot create a memmap array that way"
- self._mmap = None
+ if obj is not None:
+ if not isinstance(obj, memmap):
+ raise ValueError, "Cannot create a memmap array that way"
+ self._mmap = obj._mmap
+ else:
+ self._mmap = None
+ return
def sync(self):
self._mmap.flush()