Commit 25ebff76 authored by Tres Seaver's avatar Tres Seaver

Try invoking parent close() via super(), hoping to squash ResourceWarning.

Also, avoid shadowing the 'file' builtin / alias with locals.
parent af66ea83
...@@ -75,8 +75,8 @@ class Blob(persistent.Persistent): ...@@ -75,8 +75,8 @@ class Blob(persistent.Persistent):
raise TypeError('Blobs do not support subclassing.') raise TypeError('Blobs do not support subclassing.')
self.__setstate__() self.__setstate__()
if data is not None: if data is not None:
with self.open('w') as file: with self.open('w') as f:
file.write(data) f.write(data)
def __setstate__(self, state=None): def __setstate__(self, state=None):
# we use lists here because it will allow us to add and remove # we use lists here because it will allow us to add and remove
...@@ -315,7 +315,7 @@ class BlobFile(file): ...@@ -315,7 +315,7 @@ class BlobFile(file):
def close(self): def close(self):
self.blob.closed(self) self.blob.closed(self)
file.close(self) super(BlobFile, self).close()
_pid = str(os.getpid()) _pid = str(os.getpid())
...@@ -786,8 +786,8 @@ class BlobStorage(BlobStorageMixin): ...@@ -786,8 +786,8 @@ class BlobStorage(BlobStorageMixin):
files.sort() files.sort()
latest = files[-1] # depends on ever-increasing tids latest = files[-1] # depends on ever-increasing tids
files.remove(latest) files.remove(latest)
for file in files: for f in files:
remove_committed(os.path.join(oid_path, file)) remove_committed(os.path.join(oid_path, f))
else: else:
remove_committed_dir(oid_path) remove_committed_dir(oid_path)
continue continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment