Merged revisions 75407,75409-75413,75415,75419-75421 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75407 | antoine.pitrou | 2009-10-14 20:30:52 +0300 (Wed, 14 Oct 2009) | 3 lines

  Fix py3k warnings in the aifc module
........
  r75409 | antoine.pitrou | 2009-10-14 21:01:33 +0300 (Wed, 14 Oct 2009) | 3 lines

  Fix py3k warnings in bsddb
........
  r75410 | antoine.pitrou | 2009-10-14 21:09:45 +0300 (Wed, 14 Oct 2009) | 3 lines

  Silence a py3k warning claiming to affect Lib/calendar.py
........
  r75411 | antoine.pitrou | 2009-10-14 21:12:54 +0300 (Wed, 14 Oct 2009) | 3 lines

  Fix a py3k warning in the StringIO module (exhibited in test_codecencodings_cn)
........
  r75412 | antoine.pitrou | 2009-10-14 21:27:32 +0300 (Wed, 14 Oct 2009) | 3 lines

  Fix py3k warnings in the socket module
........
  r75413 | antoine.pitrou | 2009-10-14 21:31:05 +0300 (Wed, 14 Oct 2009) | 3 lines

  Fix a py3k warning in the sndhdr module (found with test_email)
........
  r75415 | antoine.pitrou | 2009-10-14 21:39:46 +0300 (Wed, 14 Oct 2009) | 3 lines

  Silence some py3k warnings claiming to affect _pyio
........
  r75419 | antoine.pitrou | 2009-10-14 21:56:11 +0300 (Wed, 14 Oct 2009) | 3 lines

  Silence py3k warning claiming to affect the random module
........
  r75420 | antoine.pitrou | 2009-10-14 22:04:48 +0300 (Wed, 14 Oct 2009) | 3 lines

  Fix py3k warnings in httplib
........
  r75421 | antoine.pitrou | 2009-10-14 22:09:48 +0300 (Wed, 14 Oct 2009) | 3 lines

  Fix py3k warnings in the uuid module
........
diff --git a/Lib/bsddb/dbtables.py b/Lib/bsddb/dbtables.py
index 5fbaaad..1fc3aef 100644
--- a/Lib/bsddb/dbtables.py
+++ b/Lib/bsddb/dbtables.py
@@ -398,7 +398,7 @@
                 # column names
                 newcolumnlist = copy.copy(oldcolumnlist)
                 for c in columns:
-                    if not oldcolumnhash.has_key(c):
+                    if c not in oldcolumnhash:
                         newcolumnlist.append(c)
 
                 # store the table's new extended column list
@@ -472,7 +472,7 @@
                 raise TableDBError, "unknown table"
 
             # check the validity of each column name
-            if not self.__tablecolumns.has_key(table):
+            if not table in self.__tablecolumns:
                 self.__load_column_info(table)
             for column in rowdict.keys() :
                 if not self.__tablecolumns[table].count(column):
@@ -615,7 +615,7 @@
           argument and returning a boolean.
         """
         try:
-            if not self.__tablecolumns.has_key(table):
+            if table not in self.__tablecolumns:
                 self.__load_column_info(table)
             if columns is None:
                 columns = self.__tablecolumns[table]
@@ -639,7 +639,7 @@
         argument and returning a boolean.
         """
         # check the validity of each column name
-        if not self.__tablecolumns.has_key(table):
+        if not table in self.__tablecolumns:
             self.__load_column_info(table)
         if columns is None:
             columns = self.tablecolumns[table]
@@ -709,28 +709,24 @@
                     # extract the rowid from the key
                     rowid = key[-_rowid_str_len:]
 
-                    if not rejected_rowids.has_key(rowid):
+                    if not rowid in rejected_rowids:
                         # if no condition was specified or the condition
                         # succeeds, add row to our match list.
                         if not condition or condition(data):
-                            if not matching_rowids.has_key(rowid):
+                            if not rowid in matching_rowids:
                                 matching_rowids[rowid] = {}
                             if savethiscolumndata:
                                 matching_rowids[rowid][column] = data
                         else:
-                            if matching_rowids.has_key(rowid):
+                            if rowid in matching_rowids:
                                 del matching_rowids[rowid]
                             rejected_rowids[rowid] = rowid
 
                     key, data = cur.next()
 
             except db.DBError, dberror:
-                if sys.version_info[0] < 3 :
-                    if dberror[0] != db.DB_NOTFOUND:
-                        raise
-                else :
-                    if dberror.args[0] != db.DB_NOTFOUND:
-                        raise
+                if dberror.args[0] != db.DB_NOTFOUND:
+                    raise
                 continue
 
         cur.close()
@@ -743,7 +739,7 @@
         if len(columns) > 0:
             for rowid, rowdata in matching_rowids.items():
                 for column in columns:
-                    if rowdata.has_key(column):
+                    if column in rowdata:
                         continue
                     try:
                         rowdata[column] = self.db.get(
@@ -815,13 +811,10 @@
             txn.commit()
             txn = None
 
-            if self.__tablecolumns.has_key(table):
+            if table in self.__tablecolumns:
                 del self.__tablecolumns[table]
 
         except db.DBError, dberror:
             if txn:
                 txn.abort()
-            if sys.version_info[0] < 3 :
-                raise TableDBError, dberror[1]
-            else :
-                raise TableDBError, dberror.args[1]
+            raise TableDBError(dberror.args[1])