Skip to content

Commit

Permalink
Leave the direct definition of IBlobStorage in place, only expand the…
Browse files Browse the repository at this point in the history
… definition if necessary inside the __init__.
  • Loading branch information
janjaapdriessen committed May 20, 2020
1 parent 6dfe525 commit 14e73eb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/ZODB/blob.py
Expand Up @@ -733,6 +733,7 @@ def temporaryDirectory(self):
return self.fshelper.temp_dir


@zope.interface.implementer(ZODB.interfaces.IBlobStorage)
class BlobStorage(BlobStorageMixin):
"""A wrapper/proxy storage to support blobs.
"""
Expand All @@ -753,12 +754,10 @@ def __init__(self, base_directory, storage, layout='automatic'):
self._blobs_pack_is_in_progress = False

if ZODB.interfaces.IStorageRestoreable.providedBy(storage):
iblob = ZODB.interfaces.IBlobStorageRestoreable
else:
iblob = ZODB.interfaces.IBlobStorage

zope.interface.directlyProvides(
self, iblob, zope.interface.providedBy(storage))
zope.interface.directlyProvides(
self,
ZODB.interfaces.IBlobStorageRestoreable,
zope.interface.providedBy(storage))

def __getattr__(self, name):
return getattr(self.__storage, name)
Expand Down

0 comments on commit 14e73eb

Please sign in to comment.