diff options
author | Travis Oliphant <oliphant@enthought.com> | 2007-06-08 05:50:09 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2007-06-08 05:50:09 +0000 |
commit | 33a80a6b3655c1d278298a1c5e911867bf8531fb (patch) | |
tree | cc830dd382addb2b95b67adb990a440b975d9ca7 /numpy/core/memmap.py | |
parent | 5ed8accbc947ad285c774905e369a5fbaef52344 (diff) | |
download | numpy-33a80a6b3655c1d278298a1c5e911867bf8531fb.tar.gz |
Fix so that _mmap gets carried through .transpose
Diffstat (limited to 'numpy/core/memmap.py')
-rw-r--r-- | numpy/core/memmap.py | 10 |
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() |