aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/shelve.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/shelve.py')
-rw-r--r--Lib/shelve.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/shelve.py b/Lib/shelve.py
index 50584716e9e..b53dc8b7a8e 100644
--- a/Lib/shelve.py
+++ b/Lib/shelve.py
@@ -171,6 +171,11 @@ class Shelf(collections.abc.MutableMapping):
if hasattr(self.dict, 'sync'):
self.dict.sync()
+ def reorganize(self):
+ self.sync()
+ if hasattr(self.dict, 'reorganize'):
+ self.dict.reorganize()
+
class BsdDbShelf(Shelf):
"""Shelf implementation using the "BSD" db interface.