Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
barsch committed Aug 14, 2013
1 parent 1dc4f92 commit 4650717
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions obspy/signal/spectral_estimation.py
Expand Up @@ -718,8 +718,11 @@ def save(self, filename, compress=False):
:param compress: Enable/disable file compression.
"""
if compress:
with bz2.BZ2File(filename, 'w') as file_:
pickle.dump(self, file_)
# due to an bug in older python version we can't use with
# http://bugs.python.org/issue8601
file_ = bz2.BZ2File(filename, 'w')
pickle.dump(self, file_)
file_.close()
else:
with open(filename, 'w') as file_:
pickle.dump(self, file_)
Expand Down

0 comments on commit 4650717

Please sign in to comment.