[yt-svn] commit/yt: MatthewTurk: Change these to functions, as h5py in Python3.4 returns views.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Jan 14 14:20:10 PST 2015


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/69ef89f6b31b/
Changeset:   69ef89f6b31b
Branch:      yt
User:        MatthewTurk
Date:        2015-01-14 20:25:02+00:00
Summary:     Change these to functions, as h5py in Python3.4 returns views.

Not actually having these functions return these things can cause dangling
references.
Affected #:  1 file

diff -r 4d01836b2b183101f6c1c6aed09ddf3d6e8c1b83 -r 69ef89f6b31b8ad5e2a36b39ca1781027722f2b2 yt/utilities/file_handler.py
--- a/yt/utilities/file_handler.py
+++ b/yt/utilities/file_handler.py
@@ -36,13 +36,11 @@
     def attrs(self):
         return self.handle.attrs
 
-    @property
     def keys(self):
-        return self.handle.keys
+        return list(self.handle.keys())
 
-    @property
     def items(self):
-        return self.handle.items
+        return list(self.handle.items())
 
 class FITSFileHandler(HDF5FileHandler):
     def __init__(self, filename):
@@ -57,5 +55,10 @@
     def __del__(self):
         for f in self._fits_files:
             f.close()
-            del f
+        del self._fits_files
+        del self.handle
+        self.handle = None
         super(FITSFileHandler, self).__del__()
+
+    def close(self):
+        pass

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list