[yt-svn] commit/yt: MatthewTurk: Fix unpickling of save_data/load_data calls.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Jan 22 06:18:33 PST 2014
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/84b551a47ac4/
Changeset: 84b551a47ac4
Branch: yt
User: MatthewTurk
Date: 2014-01-21 20:03:13
Summary: Fix unpickling of save_data/load_data calls.
Affected #: 1 file
diff -r 9cd93d05bd3cedfadcc3c3132e52e311de7c816f -r 84b551a47ac462d646963f0b13e4dd0e85bd9751 yt/data_objects/hierarchy.py
--- a/yt/data_objects/hierarchy.py
+++ b/yt/data_objects/hierarchy.py
@@ -319,7 +319,11 @@
obj = self.get_data("/Objects", name)
if obj is None:
return
- obj = cPickle.loads(obj.value)
+ if isinstance(obj, np.ndarray):
+ obj = obj.tostring()
+ elif hasattr(obj, 'value'):
+ obj = obj.value
+ obj = cPickle.loads(obj)
if iterable(obj) and len(obj) == 2:
obj = obj[1] # Just the object, not the pf
if hasattr(obj, '_fix_pickle'): obj._fix_pickle()
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