]> granicus.if.org Git - python/commitdiff
Fix errors found by pychecker
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 11 Jun 2006 08:35:14 +0000 (08:35 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 11 Jun 2006 08:35:14 +0000 (08:35 +0000)
Lib/bsddb/dbrecio.py
Lib/bsddb/dbtables.py
Lib/compiler/symbols.py
Lib/compiler/transformer.py
Lib/ctypes/util.py

index 22e382a39eb574e434baf9223e249502c811551d..d439f3255e986248155c4b52ed89d28063af8b28 100644 (file)
@@ -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):
index 369db43abe9d3bd13ab9f5033f99e343d477464e..492d5fdfac29c9f6c1702ab7c7b46e032e98022d 100644 (file)
@@ -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
index c608f64b284d24f6aa35833c14e1535dd5952f53..8eb5fceca79418be427a5422d2c2a14fc95de20d 100644 (file)
@@ -191,7 +191,7 @@ class GenExprScope(Scope):
         self.add_param('[outmost-iterable]')
 
     def get_names(self):
-        keys = Scope.get_names()
+        keys = Scope.get_names(self)
         return keys
 
 class LambdaScope(FunctionScope):
index e1a97752d49541b8befca1e97bbbc716df97880f..d30cc1a8d4e58b92aed6347d021e7e8cc0a7715a 100644 (file)
@@ -729,8 +729,6 @@ class Transformer:
 
     def atom(self, nodelist):
         return self._atom_dispatch[nodelist[0][0]](nodelist)
-        n.lineno = nodelist[0][2]
-        return n
 
     def atom_lpar(self, nodelist):
         if nodelist[1][0] == token.RPAR:
index d756c1c75fb8e657077a2994f19d8060b97c41f3..094b029a406b722d3bf752521bce09120e757878 100644 (file)
@@ -1,5 +1,4 @@
 import sys, os
-import ctypes
 
 # find_library(name) returns the pathname of a library, or None.
 if os.name == "nt":
@@ -41,7 +40,7 @@ if os.name == "posix" and sys.platform == "darwin":
 
 elif os.name == "posix":
     # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
-    import re, tempfile
+    import re, tempfile, errno
 
     def _findLib_gcc(name):
         expr = '[^\(\)\s]*lib%s\.[^\(\)\s]*' % name