check if 'sync' method actually exists before calling -- anydbm does not have sync()

method
This commit is contained in:
Ilya Kreymer 2014-10-28 12:49:02 -07:00
parent a0a5ef2355
commit a139465512

View File

@ -689,6 +689,7 @@ class DedupDb(object):
self.db.close()
def sync(self):
if hasattr(self.db, 'sync'):
self.db.sync()
def save(self, key, response_record, offset):
@ -999,6 +1000,7 @@ class PlaybackIndexDb(object):
def sync(self):
if hasattr(self.db, 'sync'):
self.db.sync()