summaryrefslogtreecommitdiff
path: root/numpy/core/memmap.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-01-06 21:16:37 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-01-06 21:16:37 +0000
commitea20506b9414bf8a6d86cbfd68b0e54be6466aaf (patch)
treecf6df8ccd441ab1d361560927c8265d8a84d083f /numpy/core/memmap.py
parent48079cbd5da130e0d3db4e65814fe0d8f2cbd500 (diff)
downloadnumpy-ea20506b9414bf8a6d86cbfd68b0e54be6466aaf.tar.gz
Slight change for memmap
Diffstat (limited to 'numpy/core/memmap.py')
-rw-r--r--numpy/core/memmap.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py
index 1ce068512..a9093f96a 100644
--- a/numpy/core/memmap.py
+++ b/numpy/core/memmap.py
@@ -82,6 +82,7 @@ class memmap(ndarray):
return self
def __array_finalize__(self, obj):
+ self._mmap = None
if not _globalvar:
raise ValueError, "Cannot create a memmap array that way"
@@ -89,9 +90,6 @@ class memmap(ndarray):
self._mmap.flush()
def __del__(self):
- try:
+ if self._mmap is not None:
self._mmap.flush()
del self._mmap
- except AttributeError:
- pass
-