summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-11 08:35:14 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-11 08:35:14 (GMT)
commit6aaccc6b55a684771abfdad74bea742c25ded506 (patch)
treecbc2c891e55d4efdeefc356d937c2aa5471f341e /Lib/bsddb
parente588c2ba9716a81358438b4e7cd23724dcef2ba9 (diff)
downloadcpython-6aaccc6b55a684771abfdad74bea742c25ded506.zip
cpython-6aaccc6b55a684771abfdad74bea742c25ded506.tar.gz
cpython-6aaccc6b55a684771abfdad74bea742c25ded506.tar.bz2
Fix errors found by pychecker
Diffstat (limited to 'Lib/bsddb')
-rw-r--r--Lib/bsddb/dbrecio.py6
-rw-r--r--Lib/bsddb/dbtables.py6
2 files changed, 9 insertions, 3 deletions
diff --git a/Lib/bsddb/dbrecio.py b/Lib/bsddb/dbrecio.py
index 22e382a..d439f32 100644
--- a/Lib/bsddb/dbrecio.py
+++ b/Lib/bsddb/dbrecio.py
@@ -75,7 +75,7 @@ class DBRecIO:
dlen = newpos - self.pos
- r = self.db.get(key, txn=self.txn, dlen=dlen, doff=self.pos)
+ r = self.db.get(self.key, txn=self.txn, dlen=dlen, doff=self.pos)
self.pos = newpos
return r
@@ -121,7 +121,7 @@ class DBRecIO:
"Negative size not allowed")
elif size < self.pos:
self.pos = size
- self.db.put(key, "", txn=self.txn, dlen=self.len-size, doff=size)
+ self.db.put(self.key, "", txn=self.txn, dlen=self.len-size, doff=size)
def write(self, s):
if self.closed:
@@ -131,7 +131,7 @@ class DBRecIO:
self.buflist.append('\0'*(self.pos - self.len))
self.len = self.pos
newpos = self.pos + len(s)
- self.db.put(key, s, txn=self.txn, dlen=len(s), doff=self.pos)
+ self.db.put(self.key, s, txn=self.txn, dlen=len(s), doff=self.pos)
self.pos = newpos
def writelines(self, list):
diff --git a/Lib/bsddb/dbtables.py b/Lib/bsddb/dbtables.py
index 369db43..492d5fd 100644
--- a/Lib/bsddb/dbtables.py
+++ b/Lib/bsddb/dbtables.py
@@ -32,6 +32,12 @@ except ImportError:
# For Python 2.3
from bsddb.db import *
+# XXX(nnorwitz): is this correct? DBIncompleteError is conditional in _bsddb.c
+try:
+ DBIncompleteError
+except NameError:
+ class DBIncompleteError(Exception):
+ pass
class TableDBError(StandardError):
pass