few minor just in case updates

This commit is contained in:
Miroslav Stampar 2012-02-27 11:15:53 +00:00
parent 85125018a1
commit 3909658fc2
2 changed files with 5 additions and 1 deletions

View File

@ -79,6 +79,7 @@ class Dump:
self._outputBP = StringIO.StringIO()
def getOutputFile(self):
self.flush()
return self._outputFile
def string(self, header, data, sort=True):

View File

@ -10,6 +10,7 @@ See the file 'doc/COPYING' for copying permission
import hashlib
import sqlite3
import threading
import time
from lib.core.common import serializeObject
from lib.core.common import unserializeObject
@ -101,8 +102,10 @@ class HashDB(object):
except sqlite3.IntegrityError:
self.cursor.execute("UPDATE storage SET value=? WHERE id=?", (value, hash_,))
except sqlite3.OperationalError, ex:
if not 'locked' in ex.message:
if not any(_ in ex.message for _ in ('locked', 'I/O')):
raise
else:
time.sleep(1)
else:
break
finally: