Commit d84da1b6 authored by Guido van Rossum's avatar Guido van Rossum

More fixes related to removal of exception slicing.

parent 782ff275
...@@ -263,7 +263,7 @@ class bsdTableDB : ...@@ -263,7 +263,7 @@ class bsdTableDB :
except DBError as dberror: except DBError as dberror:
if txn: if txn:
txn.abort() txn.abort()
raise TableDBError, dberror[1] raise TableDBError, dberror.args[1]
def ListTableColumns(self, table): def ListTableColumns(self, table):
...@@ -341,7 +341,7 @@ class bsdTableDB : ...@@ -341,7 +341,7 @@ class bsdTableDB :
except DBError as dberror: except DBError as dberror:
if txn: if txn:
txn.abort() txn.abort()
raise TableDBError, dberror[1] raise TableDBError, dberror.args[1]
def __load_column_info(self, table) : def __load_column_info(self, table) :
...@@ -416,7 +416,7 @@ class bsdTableDB : ...@@ -416,7 +416,7 @@ class bsdTableDB :
if txn: if txn:
txn.abort() txn.abort()
self.db.delete(_rowid_key(table, rowid)) self.db.delete(_rowid_key(table, rowid))
raise TableDBError, dberror[1], info[2] raise TableDBError, dberror.args[1], info[2]
def Modify(self, table, conditions={}, mappings={}): def Modify(self, table, conditions={}, mappings={}):
...@@ -467,7 +467,7 @@ class bsdTableDB : ...@@ -467,7 +467,7 @@ class bsdTableDB :
raise raise
except DBError as dberror: except DBError as dberror:
raise TableDBError, dberror[1] raise TableDBError, dberror.args[1]
def Delete(self, table, conditions={}): def Delete(self, table, conditions={}):
"""Delete(table, conditions) - Delete items matching the given """Delete(table, conditions) - Delete items matching the given
...@@ -507,7 +507,7 @@ class bsdTableDB : ...@@ -507,7 +507,7 @@ class bsdTableDB :
txn.abort() txn.abort()
raise raise
except DBError as dberror: except DBError as dberror:
raise TableDBError, dberror[1] raise TableDBError, dberror.args[1]
def Select(self, table, columns, conditions={}): def Select(self, table, columns, conditions={}):
...@@ -527,7 +527,7 @@ class bsdTableDB : ...@@ -527,7 +527,7 @@ class bsdTableDB :
columns = self.__tablecolumns[table] columns = self.__tablecolumns[table]
matching_rowids = self.__Select(table, columns, conditions) matching_rowids = self.__Select(table, columns, conditions)
except DBError as dberror: except DBError as dberror:
raise TableDBError, dberror[1] raise TableDBError, dberror.args[1]
# return the matches as a list of dictionaries # return the matches as a list of dictionaries
return matching_rowids.values() return matching_rowids.values()
...@@ -617,7 +617,7 @@ class bsdTableDB : ...@@ -617,7 +617,7 @@ class bsdTableDB :
key, data = cur.next() key, data = cur.next()
except DBError as dberror: except DBError as dberror:
if dberror[0] != DB_NOTFOUND: if dberror.args[0] != DB_NOTFOUND:
raise raise
continue continue
...@@ -637,7 +637,7 @@ class bsdTableDB : ...@@ -637,7 +637,7 @@ class bsdTableDB :
rowdata[column] = self.db.get( rowdata[column] = self.db.get(
_data_key(table, column, rowid)) _data_key(table, column, rowid))
except DBError as dberror: except DBError as dberror:
if dberror[0] != DB_NOTFOUND: if dberror.args[0] != DB_NOTFOUND:
raise raise
rowdata[column] = None rowdata[column] = None
...@@ -703,4 +703,4 @@ class bsdTableDB : ...@@ -703,4 +703,4 @@ class bsdTableDB :
except DBError as dberror: except DBError as dberror:
if txn: if txn:
txn.abort() txn.abort()
raise TableDBError, dberror[1] raise TableDBError, dberror.args[1]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment