mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
Convert raise statements in bsddb.
This commit is contained in:
parent
865ea89201
commit
a65e94c1bf
9 changed files with 33 additions and 33 deletions
|
|
@ -69,7 +69,7 @@ def open(filename, flags=db.DB_CREATE, mode=0o660, filetype=db.DB_HASH,
|
|||
elif sflag == 'n':
|
||||
flags = db.DB_TRUNCATE | db.DB_CREATE
|
||||
else:
|
||||
raise db.DBError, "flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags"
|
||||
raise db.DBError("flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags")
|
||||
|
||||
d = DBShelf(dbenv)
|
||||
d.open(filename, dbname, filetype, flags, mode)
|
||||
|
|
@ -155,7 +155,7 @@ class DBShelf(DictMixin):
|
|||
if self.get_type() != db.DB_RECNO:
|
||||
self.append = self.__append
|
||||
return self.append(value, txn=txn)
|
||||
raise db.DBError, "append() only supported when dbshelve opened with filetype=dbshelve.db.DB_RECNO"
|
||||
raise db.DBError("append() only supported when dbshelve opened with filetype=dbshelve.db.DB_RECNO")
|
||||
|
||||
|
||||
def associate(self, secondaryDB, callback, flags=0):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue