Browse files

BUG: fix numpy_pickle huge bugs

  • Loading branch information...
1 parent a98b0eb commit 912edc01c482f095f24ca85b8263be035c0b50f2 @GaelVaroquaux GaelVaroquaux committed Feb 5, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 joblib/numpy_pickle.py
View
16 joblib/numpy_pickle.py
@@ -206,13 +206,13 @@ def _write_array(self, array, filename):
# numerics in a z-file
_, init_args, state = array.__reduce__()
# the last entry of 'state' is the data itself
- zfile = open(filename, 'wb')
- write_zfile(zfile, state[-1],
- compress=self.compress)
- zfile.close()
- state = state[:-1]
- container = ZNDArrayWrapper(os.path.basename(filename),
- init_args, state)
+ zfile = open(filename, 'wb')
+ write_zfile(zfile, state[-1],
+ compress=self.compress)
+ zfile.close()
+ state = state[:-1]
+ container = ZNDArrayWrapper(os.path.basename(filename),
+ init_args, state)
return container, filename
def save(self, obj):
@@ -250,7 +250,7 @@ def close(self):
zfile = open(self._filename, 'wb')
write_zfile(zfile,
self.file.getvalue(), self.compress)
- zfile.close()
+ zfile.close()
class NumpyUnpickler(Unpickler):

0 comments on commit 912edc0

Please sign in to comment.