Browse Source

Prevent ResourceWarning

pull/189/head
Oliverpool 9 years ago
parent
commit
713241a3c1
  1. 3
      patacrep/songs/__init__.py

3
patacrep/songs/__init__.py

@ -194,9 +194,10 @@ class Song:
# https://bugs.python.org/issue1692335 # https://bugs.python.org/issue1692335
return return
cached = {attr: getattr(self, attr) for attr in self.cached_attributes} cached = {attr: getattr(self, attr) for attr in self.cached_attributes}
with open(self.cached_name, 'wb') as cache_file:
pickle.dump( pickle.dump(
cached, cached,
open(self.cached_name, 'wb'), cache_file,
protocol=-1 protocol=-1
) )

Loading…
Cancel
Save