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.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
-