Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

  Untabify C files. Will watch buildbots.
........
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index 5aedfca..755242c 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -139,9 +139,9 @@
 /* and these are for calling C --> Python */
 #if defined(MYDB_USE_GILSTATE)
 #define MYDB_BEGIN_BLOCK_THREADS \
-		PyGILState_STATE __savestate = PyGILState_Ensure();
+                PyGILState_STATE __savestate = PyGILState_Ensure();
 #define MYDB_END_BLOCK_THREADS \
-		PyGILState_Release(__savestate);
+                PyGILState_Release(__savestate);
 #else /* MYDB_USE_GILSTATE */
 /* Pre GILState API - do it the long old way */
 static PyInterpreterState* _db_interpreterState = NULL;
@@ -212,7 +212,7 @@
 static PyObject* DBRepUnavailError;     /* DB_REP_UNAVAIL */
 
 #if (DBVER < 43)
-#define	DB_BUFFER_SMALL		ENOMEM
+#define DB_BUFFER_SMALL         ENOMEM
 #endif
 
 
@@ -537,7 +537,7 @@
 
     srclen = strlen(src);
     if (n <= 0)
-	return srclen;
+        return srclen;
     copylen = (srclen > n-1) ? n-1 : srclen;
     /* populate dest[0] thru dest[copylen-1] */
     memcpy(dest, src, copylen);
@@ -554,7 +554,7 @@
 static void _db_errorCallback(const char* prefix, char* msg)
 #else
 static void _db_errorCallback(const DB_ENV *db_env,
-	const char* prefix, const char* msg)
+        const char* prefix, const char* msg)
 #endif
 {
     our_strlcpy(_db_errmsg, msg, sizeof(_db_errmsg));
@@ -676,7 +676,7 @@
             /* Ensure that bytes_left never goes negative */
             if (_db_errmsg[0] && bytes_left < (sizeof(errTxt) - 4)) {
                 bytes_left = sizeof(errTxt) - bytes_left - 4 - 1;
-		assert(bytes_left >= 0);
+                assert(bytes_left >= 0);
                 strcat(errTxt, " -- ");
                 strncat(errTxt, _db_errmsg, bytes_left);
             }
@@ -705,8 +705,8 @@
         case DB_BUFFER_SMALL:       errObj = DBNoMemoryError;       break;
 
 #if (DBVER >= 43)
-	/* ENOMEM and DB_BUFFER_SMALL were one and the same until 4.3 */
-	case ENOMEM:  errObj = PyExc_MemoryError;   break;
+        /* ENOMEM and DB_BUFFER_SMALL were one and the same until 4.3 */
+        case ENOMEM:  errObj = PyExc_MemoryError;   break;
 #endif
         case EINVAL:  errObj = DBInvalidArgError;   break;
         case EACCES:  errObj = DBAccessError;       break;
@@ -811,7 +811,7 @@
 
 /* Get a key/data pair from a cursor */
 static PyObject* _DBCursor_get(DBCursorObject* self, int extra_flags,
-			       PyObject *args, PyObject *kwargs, char *format)
+                               PyObject *args, PyObject *kwargs, char *format)
 {
     int err;
     PyObject* retval = NULL;
@@ -822,7 +822,7 @@
     static char* kwnames[] = { "flags", "dlen", "doff", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, format, kwnames,
-				     &flags, &dlen, &doff)) 
+                                     &flags, &dlen, &doff))
       return NULL;
 
     CHECK_CURSOR_NOT_CLOSED(self);
@@ -838,7 +838,7 @@
     MYDB_END_ALLOW_THREADS;
 
     if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	    && self->mydb->moduleFlags.getReturnsNone) {
+            && self->mydb->moduleFlags.getReturnsNone) {
         Py_INCREF(Py_None);
         retval = Py_None;
     }
@@ -882,13 +882,13 @@
 static void _addTimeTToDict(PyObject* dict, char *name, time_t value)
 {
     PyObject* v;
-	/* if the value fits in regular int, use that. */
+        /* if the value fits in regular int, use that. */
 #ifdef PY_LONG_LONG
-	if (sizeof(time_t) > sizeof(long))
-		v = PyLong_FromLongLong((PY_LONG_LONG) value);
-	else
+        if (sizeof(time_t) > sizeof(long))
+                v = PyLong_FromLongLong((PY_LONG_LONG) value);
+        else
 #endif
-		v = NUMBER_FromLong((long) value);
+                v = NUMBER_FromLong((long) value);
     if (!v || PyDict_SetItemString(dict, name, v))
         PyErr_Clear();
 
@@ -1038,10 +1038,10 @@
 
     INSERT_IN_DOUBLE_LINKED_LIST(self->mydb->children_cursors,self);
     if (txn && ((PyObject *)txn!=Py_None)) {
-	    INSERT_IN_DOUBLE_LINKED_LIST_TXN(txn->children_cursors,self);
-	    self->txn=txn;
+            INSERT_IN_DOUBLE_LINKED_LIST_TXN(txn->children_cursors,self);
+            self->txn=txn;
     } else {
-	    self->txn=NULL;
+            self->txn=NULL;
     }
 
     self->in_weakreflist = NULL;
@@ -1406,16 +1406,16 @@
             PyBytes_AsStringAndSize(result, &data, &size);
             secKey->flags = DB_DBT_APPMALLOC;   /* DB will free */
             secKey->data = malloc(size);        /* TODO, check this */
-	    if (secKey->data) {
-		memcpy(secKey->data, data, size);
-		secKey->size = size;
-		retval = 0;
-	    }
-	    else {
-		PyErr_SetString(PyExc_MemoryError,
+            if (secKey->data) {
+                memcpy(secKey->data, data, size);
+                secKey->size = size;
+                retval = 0;
+            }
+            else {
+                PyErr_SetString(PyExc_MemoryError,
                                 "malloc failed in _db_associateCallback");
-		PyErr_Print();
-	    }
+                PyErr_Print();
+            }
         }
         else {
             PyErr_SetString(
@@ -1499,7 +1499,7 @@
     MYDB_BEGIN_ALLOW_THREADS;
 #if (DBVER >= 41)
     err = self->db->associate(self->db,
-	                      txn,
+                              txn,
                               secondaryDB->db,
                               _db_associateCallback,
                               flags);
@@ -1617,7 +1617,7 @@
     MYDB_END_ALLOW_THREADS;
 
     if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	    && self->moduleFlags.getReturnsNone) {
+            && self->moduleFlags.getReturnsNone) {
         err = 0;
         Py_INCREF(Py_None);
         retval = Py_None;
@@ -1764,7 +1764,7 @@
         retval = dfltobj;
     }
     else if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	     && self->moduleFlags.getReturnsNone) {
+             && self->moduleFlags.getReturnsNone) {
         err = 0;
         Py_INCREF(Py_None);
         retval = Py_None;
@@ -1833,7 +1833,7 @@
         retval = dfltobj;
     }
     else if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	     && self->moduleFlags.getReturnsNone) {
+             && self->moduleFlags.getReturnsNone) {
         err = 0;
         Py_INCREF(Py_None);
         retval = Py_None;
@@ -1968,7 +1968,7 @@
     MYDB_END_ALLOW_THREADS;
 
     if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	    && self->moduleFlags.getReturnsNone) {
+            && self->moduleFlags.getReturnsNone) {
         err = 0;
         Py_INCREF(Py_None);
         retval = Py_None;
@@ -2042,8 +2042,8 @@
     length = PyObject_Length(cursorsObj);
     cursors = malloc((length+1) * sizeof(DBC*));
     if (!cursors) {
-	PyErr_NoMemory();
-	return NULL;
+        PyErr_NoMemory();
+        return NULL;
     }
 
     cursors[length] = NULL;
@@ -2134,28 +2134,28 @@
 
 #if (DBVER >= 41)
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z|ziiiO:open", kwnames,
-				     &filename, &dbname, &type, &flags, &mode,
+                                     &filename, &dbname, &type, &flags, &mode,
                                      &txnobj))
 #else
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z|ziii:open", kwnames,
-				     &filename, &dbname, &type, &flags,
+                                     &filename, &dbname, &type, &flags,
                                      &mode))
 #endif
     {
-	PyErr_Clear();
-	type = DB_UNKNOWN; flags = 0; mode = 0660;
-	filename = NULL; dbname = NULL;
+        PyErr_Clear();
+        type = DB_UNKNOWN; flags = 0; mode = 0660;
+        filename = NULL; dbname = NULL;
 #if (DBVER >= 41)
-	if (!PyArg_ParseTupleAndKeywords(args, kwargs,"z|iiiO:open",
+        if (!PyArg_ParseTupleAndKeywords(args, kwargs,"z|iiiO:open",
                                          kwnames_basic,
-					 &filename, &type, &flags, &mode,
+                                         &filename, &type, &flags, &mode,
                                          &txnobj))
-	    return NULL;
+            return NULL;
 #else
-	if (!PyArg_ParseTupleAndKeywords(args, kwargs,"z|iii:open",
+        if (!PyArg_ParseTupleAndKeywords(args, kwargs,"z|iii:open",
                                          kwnames_basic,
-					 &filename, &type, &flags, &mode))
-	    return NULL;
+                                         &filename, &type, &flags, &mode))
+            return NULL;
 #endif
     }
 
@@ -2338,20 +2338,20 @@
 
 static int
 _default_cmp(const DBT *leftKey,
-	     const DBT *rightKey)
+             const DBT *rightKey)
 {
   int res;
   int lsize = leftKey->size, rsize = rightKey->size;
 
   res = memcmp(leftKey->data, rightKey->data,
-	       lsize < rsize ? lsize : rsize);
+               lsize < rsize ? lsize : rsize);
 
   if (res == 0) {
       if (lsize < rsize) {
-	  res = -1;
+          res = -1;
       }
       else if (lsize > rsize) {
-	  res = 1;
+          res = 1;
       }
   }
   return res;
@@ -2359,8 +2359,8 @@
 
 static int
 _db_compareCallback(DB* db,
-		    const DBT *leftKey,
-		    const DBT *rightKey)
+                    const DBT *leftKey,
+                    const DBT *rightKey)
 {
     int res = 0;
     PyObject *args;
@@ -2368,40 +2368,40 @@
     DBObject *self = (DBObject *)db->app_private;
 
     if (self == NULL || self->btCompareCallback == NULL) {
-	MYDB_BEGIN_BLOCK_THREADS;
-	PyErr_SetString(PyExc_TypeError,
-			(self == 0
-			 ? "DB_bt_compare db is NULL."
-			 : "DB_bt_compare callback is NULL."));
-	/* we're in a callback within the DB code, we can't raise */
-	PyErr_Print();
-	res = _default_cmp(leftKey, rightKey);
-	MYDB_END_BLOCK_THREADS;
+        MYDB_BEGIN_BLOCK_THREADS;
+        PyErr_SetString(PyExc_TypeError,
+                        (self == 0
+                         ? "DB_bt_compare db is NULL."
+                         : "DB_bt_compare callback is NULL."));
+        /* we're in a callback within the DB code, we can't raise */
+        PyErr_Print();
+        res = _default_cmp(leftKey, rightKey);
+        MYDB_END_BLOCK_THREADS;
     } else {
-	MYDB_BEGIN_BLOCK_THREADS;
+        MYDB_BEGIN_BLOCK_THREADS;
 
-	args = BuildValue_SS(leftKey->data, leftKey->size, rightKey->data, rightKey->size);
-	if (args != NULL) {
-		result = PyEval_CallObject(self->btCompareCallback, args);
-	}
-	if (args == NULL || result == NULL) {
-	    /* we're in a callback within the DB code, we can't raise */
-	    PyErr_Print();
-	    res = _default_cmp(leftKey, rightKey);
-	} else if (NUMBER_Check(result)) {
-	    res = NUMBER_AsLong(result);
-	} else {
-	    PyErr_SetString(PyExc_TypeError,
-			    "DB_bt_compare callback MUST return an int.");
-	    /* we're in a callback within the DB code, we can't raise */
-	    PyErr_Print();
-	    res = _default_cmp(leftKey, rightKey);
-	}
+        args = BuildValue_SS(leftKey->data, leftKey->size, rightKey->data, rightKey->size);
+        if (args != NULL) {
+                result = PyEval_CallObject(self->btCompareCallback, args);
+        }
+        if (args == NULL || result == NULL) {
+            /* we're in a callback within the DB code, we can't raise */
+            PyErr_Print();
+            res = _default_cmp(leftKey, rightKey);
+        } else if (NUMBER_Check(result)) {
+            res = NUMBER_AsLong(result);
+        } else {
+            PyErr_SetString(PyExc_TypeError,
+                            "DB_bt_compare callback MUST return an int.");
+            /* we're in a callback within the DB code, we can't raise */
+            PyErr_Print();
+            res = _default_cmp(leftKey, rightKey);
+        }
 
-	Py_XDECREF(args);
-	Py_XDECREF(result);
+        Py_XDECREF(args);
+        Py_XDECREF(result);
 
-	MYDB_END_BLOCK_THREADS;
+        MYDB_END_BLOCK_THREADS;
     }
     return res;
 }
@@ -2415,8 +2415,8 @@
     CHECK_DB_NOT_CLOSED(self);
 
     if (!PyCallable_Check(comparator)) {
-	makeTypeError("Callable", comparator);
-	return NULL;
+        makeTypeError("Callable", comparator);
+        return NULL;
     }
 
     /*
@@ -2430,15 +2430,15 @@
     if (result == NULL)
         return NULL;
     if (!NUMBER_Check(result)) {
-	Py_DECREF(result);
-	PyErr_SetString(PyExc_TypeError,
-		        "callback MUST return an int");
-	return NULL;
+        Py_DECREF(result);
+        PyErr_SetString(PyExc_TypeError,
+                        "callback MUST return an int");
+        return NULL;
     } else if (NUMBER_AsLong(result) != 0) {
-	Py_DECREF(result);
-	PyErr_SetString(PyExc_TypeError,
-		        "callback failed to return 0 on two empty strings");
-	return NULL;
+        Py_DECREF(result);
+        PyErr_SetString(PyExc_TypeError,
+                        "callback failed to return 0 on two empty strings");
+        return NULL;
     }
     Py_DECREF(result);
 
@@ -2446,8 +2446,8 @@
      * simplify the code. This would have no real use, as one cannot
      * change the function once the db is opened anyway */
     if (self->btCompareCallback != NULL) {
-	PyErr_SetString(PyExc_RuntimeError, "set_bt_compare() cannot be called more than once");
-	return NULL;
+        PyErr_SetString(PyExc_RuntimeError, "set_bt_compare() cannot be called more than once");
+        return NULL;
     }
 
     Py_INCREF(comparator);
@@ -2462,9 +2462,9 @@
     err = self->db->set_bt_compare(self->db, _db_compareCallback);
 
     if (err) {
-	/* restore the old state in case of error */
-	Py_DECREF(comparator);
-	self->btCompareCallback = NULL;
+        /* restore the old state in case of error */
+        Py_DECREF(comparator);
+        self->btCompareCallback = NULL;
     }
 
     RETURN_IF_ERR();
@@ -2885,8 +2885,8 @@
     CHECK_DB_NOT_CLOSED(self);
     if (outFileName)
         outFile = fopen(outFileName, "w");
-	/* XXX(nnorwitz): it should probably be an exception if outFile
-	   can't be opened. */
+        /* XXX(nnorwitz): it should probably be an exception if outFile
+           can't be opened. */
 
     {  /* DB.verify acts as a DB handle destructor (like close) */
         PyObject *error;
@@ -2940,8 +2940,8 @@
     static char* kwnames[] = { "passwd", "flags", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|i:set_encrypt", kwnames,
-		&passwd, &flags)) {
-	return NULL;
+                &passwd, &flags)) {
+        return NULL;
     }
 
     MYDB_BEGIN_ALLOW_THREADS;
@@ -3414,12 +3414,12 @@
     CLEAR_DBT(key);
     CLEAR_DBT(data);
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|ii:get", &kwnames[2],
-				     &flags, &dlen, &doff))
+                                     &flags, &dlen, &doff))
     {
         PyErr_Clear();
         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Oi|ii:get",
                                          &kwnames[1],
-					 &keyobj, &flags, &dlen, &doff))
+                                         &keyobj, &flags, &dlen, &doff))
         {
             PyErr_Clear();
             if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOi|ii:get",
@@ -3427,8 +3427,8 @@
                                              &flags, &dlen, &doff))
             {
                 return NULL;
-	    }
-	}
+            }
+        }
     }
 
     CHECK_CURSOR_NOT_CLOSED(self);
@@ -3447,7 +3447,7 @@
     MYDB_END_ALLOW_THREADS;
 
     if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	    && self->mydb->moduleFlags.getReturnsNone) {
+            && self->mydb->moduleFlags.getReturnsNone) {
         Py_INCREF(Py_None);
         retval = Py_None;
     }
@@ -3490,12 +3490,12 @@
     CLEAR_DBT(key);
     CLEAR_DBT(data);
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|ii:pget", &kwnames[2],
-				     &flags, &dlen, &doff))
+                                     &flags, &dlen, &doff))
     {
         PyErr_Clear();
         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Oi|ii:pget",
-                                         kwnames_keyOnly, 
-					 &keyobj, &flags, &dlen, &doff))
+                                         kwnames_keyOnly,
+                                         &keyobj, &flags, &dlen, &doff))
         {
             PyErr_Clear();
             if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOi|ii:pget",
@@ -3503,8 +3503,8 @@
                                              &flags, &dlen, &doff))
             {
                 return NULL;
-	    }
-	}
+            }
+        }
     }
 
     CHECK_CURSOR_NOT_CLOSED(self);
@@ -3525,7 +3525,7 @@
     MYDB_END_ALLOW_THREADS;
 
     if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	    && self->mydb->moduleFlags.getReturnsNone) {
+            && self->mydb->moduleFlags.getReturnsNone) {
         Py_INCREF(Py_None);
         retval = Py_None;
     }
@@ -3636,7 +3636,7 @@
     int doff = -1;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|iii:put", kwnames,
-				     &keyobj, &dataobj, &flags, &dlen, &doff))
+                                     &keyobj, &dataobj, &flags, &dlen, &doff))
         return NULL;
 
     CHECK_CURSOR_NOT_CLOSED(self);
@@ -3671,7 +3671,7 @@
     int doff = -1;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|iii:set", kwnames,
-				     &keyobj, &flags, &dlen, &doff))
+                                     &keyobj, &flags, &dlen, &doff))
         return NULL;
 
     CHECK_CURSOR_NOT_CLOSED(self);
@@ -3689,7 +3689,7 @@
     err = _DBC_get(self->dbc, &key, &data, flags|DB_SET);
     MYDB_END_ALLOW_THREADS;
     if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	    && self->mydb->moduleFlags.cursorSetReturnsNone) {
+            && self->mydb->moduleFlags.cursorSetReturnsNone) {
         Py_INCREF(Py_None);
         retval = Py_None;
     }
@@ -3734,7 +3734,7 @@
     int doff = -1;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|iii:set_range", kwnames,
-				     &keyobj, &flags, &dlen, &doff))
+                                     &keyobj, &flags, &dlen, &doff))
         return NULL;
 
     CHECK_CURSOR_NOT_CLOSED(self);
@@ -3751,7 +3751,7 @@
     err = _DBC_get(self->dbc, &key, &data, flags|DB_SET_RANGE);
     MYDB_END_ALLOW_THREADS;
     if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	    && self->mydb->moduleFlags.cursorSetReturnsNone) {
+            && self->mydb->moduleFlags.cursorSetReturnsNone) {
         Py_INCREF(Py_None);
         retval = Py_None;
     }
@@ -3905,7 +3905,7 @@
     static char* kwnames[] = { "recno","flags", "dlen", "doff", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|iii:set_recno", kwnames,
-				     &irecno, &flags, &dlen, &doff))
+                                     &irecno, &flags, &dlen, &doff))
       return NULL;
 
     CHECK_CURSOR_NOT_CLOSED(self);
@@ -3934,7 +3934,7 @@
     err = _DBC_get(self->dbc, &key, &data, flags|DB_SET_RECNO);
     MYDB_END_ALLOW_THREADS;
     if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	    && self->mydb->moduleFlags.cursorSetReturnsNone) {
+            && self->mydb->moduleFlags.cursorSetReturnsNone) {
         Py_INCREF(Py_None);
         retval = Py_None;
     }
@@ -3997,7 +3997,7 @@
     err = _DBC_get(self->dbc, &key, &data, flags | DB_JOIN_ITEM);
     MYDB_END_ALLOW_THREADS;
     if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)
-	    && self->mydb->moduleFlags.getReturnsNone) {
+            && self->mydb->moduleFlags.getReturnsNone) {
         Py_INCREF(Py_None);
         retval = Py_None;
     }
@@ -4109,8 +4109,8 @@
                                      NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|zOi:dbremove", kwnames,
-		&file, &database, &txnobj, &flags)) {
-	return NULL;
+                &file, &database, &txnobj, &flags)) {
+        return NULL;
     }
     if (!checkTxnObj(txnobj, &txn)) {
         return NULL;
@@ -4137,8 +4137,8 @@
                                      "flags", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "szs|Oi:dbrename", kwnames,
-		&file, &database, &newname, &txnobj, &flags)) {
-	return NULL;
+                &file, &database, &newname, &txnobj, &flags)) {
+        return NULL;
     }
     if (!checkTxnObj(txnobj, &txn)) {
         return NULL;
@@ -4161,8 +4161,8 @@
     static char* kwnames[] = { "passwd", "flags", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|i:set_encrypt", kwnames,
-		&passwd, &flags)) {
-	return NULL;
+                &passwd, &flags)) {
+        return NULL;
     }
 
     MYDB_BEGIN_ALLOW_THREADS;
@@ -4183,8 +4183,8 @@
     static char* kwnames[] = { "timeout", "flags", NULL };
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:set_timeout", kwnames,
-		&timeout, &flags)) {
-	return NULL;
+                &timeout, &flags)) {
+        return NULL;
     }
 
     MYDB_BEGIN_ALLOW_THREADS;
@@ -5146,8 +5146,8 @@
     CHECK_ENV_NOT_CLOSED(self);
 
     if (!PyCallable_Check(notifyFunc)) {
-	    makeTypeError("Callable", notifyFunc);
-	    return NULL;
+            makeTypeError("Callable", notifyFunc);
+            return NULL;
     }
 
     Py_XDECREF(self->event_notifyCallback);
@@ -5165,8 +5165,8 @@
     MYDB_END_ALLOW_THREADS;
 
     if (err) {
-	    Py_DECREF(notifyFunc);
-	    self->event_notifyCallback = NULL;
+            Py_DECREF(notifyFunc);
+            self->event_notifyCallback = NULL;
     }
 
     RETURN_IF_ERR();
@@ -5487,7 +5487,7 @@
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
                 "i|O:rep_start", kwnames, &flags, &cdata_py))
     {
-	    return NULL;
+            return NULL;
     }
     CHECK_ENV_NOT_CLOSED(self);
 
@@ -5640,7 +5640,7 @@
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
                 "ii:repmgr_start", kwnames, &nthreads, &flags))
     {
-	    return NULL;
+            return NULL;
     }
     CHECK_ENV_NOT_CLOSED(self);
     MYDB_BEGIN_ALLOW_THREADS;
@@ -5663,7 +5663,7 @@
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
                 "si|i:repmgr_set_local_site", kwnames, &host, &port, &flags))
     {
-	    return NULL;
+            return NULL;
     }
     CHECK_ENV_NOT_CLOSED(self);
     MYDB_BEGIN_ALLOW_THREADS;
@@ -5687,7 +5687,7 @@
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
                 "si|i:repmgr_add_remote_site", kwnames, &host, &port, &flags))
     {
-	    return NULL;
+            return NULL;
     }
     CHECK_ENV_NOT_CLOSED(self);
     MYDB_BEGIN_ALLOW_THREADS;
@@ -5705,7 +5705,7 @@
 
     if (!PyArg_ParseTuple(args, "i:repmgr_set_ack_policy", &ack_policy))
     {
-	    return NULL;
+            return NULL;
     }
     CHECK_ENV_NOT_CLOSED(self);
     MYDB_BEGIN_ALLOW_THREADS;
@@ -5880,7 +5880,7 @@
             /* The db is already linked to its environment,
             ** so nothing to do.
             */
-            db->txn=NULL; 
+            db->txn=NULL;
         }
     }
 
@@ -6682,20 +6682,20 @@
     0,          /*tp_as_sequence*/
     &DB_mapping,/*tp_as_mapping*/
     0,          /*tp_hash*/
-    0,			/* tp_call */
-    0,			/* tp_str */
-    0,  		/* tp_getattro */
+    0,                  /* tp_call */
+    0,                  /* tp_str */
+    0,                  /* tp_getattro */
     0,          /* tp_setattro */
-    0,			/* tp_as_buffer */
+    0,                  /* tp_as_buffer */
 #if (PY_VERSION_HEX < 0x03000000)
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_WEAKREFS,      /* tp_flags */
 #else
     Py_TPFLAGS_DEFAULT,      /* tp_flags */
 #endif
     0,          /* tp_doc */
-    0,		    /* tp_traverse */
-    0,			/* tp_clear */
-    0,			/* tp_richcompare */
+    0,              /* tp_traverse */
+    0,                  /* tp_clear */
+    0,                  /* tp_richcompare */
     offsetof(DBObject, in_weakreflist),   /* tp_weaklistoffset */
     0,          /*tp_iter*/
     0,          /*tp_iternext*/
@@ -6768,20 +6768,20 @@
     0,          /*tp_as_sequence*/
     0,          /*tp_as_mapping*/
     0,          /*tp_hash*/
-    0,			/* tp_call */
-    0,			/* tp_str */
-    0,  		/* tp_getattro */
+    0,                  /* tp_call */
+    0,                  /* tp_str */
+    0,                  /* tp_getattro */
     0,          /* tp_setattro */
-    0,			/* tp_as_buffer */
+    0,                  /* tp_as_buffer */
 #if (PY_VERSION_HEX < 0x03000000)
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_WEAKREFS,      /* tp_flags */
 #else
     Py_TPFLAGS_DEFAULT,      /* tp_flags */
 #endif
     0,          /* tp_doc */
-    0,		    /* tp_traverse */
-    0,			/* tp_clear */
-    0,			/* tp_richcompare */
+    0,              /* tp_traverse */
+    0,                  /* tp_clear */
+    0,                  /* tp_richcompare */
     offsetof(DBEnvObject, in_weakreflist),   /* tp_weaklistoffset */
     0,          /* tp_iter */
     0,          /* tp_iternext */
@@ -6811,20 +6811,20 @@
     0,          /*tp_as_sequence*/
     0,          /*tp_as_mapping*/
     0,          /*tp_hash*/
-    0,			/* tp_call */
-    0,			/* tp_str */
-    0,  		/* tp_getattro */
+    0,                  /* tp_call */
+    0,                  /* tp_str */
+    0,                  /* tp_getattro */
     0,          /* tp_setattro */
-    0,			/* tp_as_buffer */
+    0,                  /* tp_as_buffer */
 #if (PY_VERSION_HEX < 0x03000000)
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_WEAKREFS,      /* tp_flags */
 #else
     Py_TPFLAGS_DEFAULT,      /* tp_flags */
 #endif
     0,          /* tp_doc */
-    0,	        /* tp_traverse */
-    0,			/* tp_clear */
-    0,			/* tp_richcompare */
+    0,          /* tp_traverse */
+    0,                  /* tp_clear */
+    0,                  /* tp_richcompare */
     offsetof(DBTxnObject, in_weakreflist),   /* tp_weaklistoffset */
     0,          /*tp_iter*/
     0,          /*tp_iternext*/
@@ -6854,20 +6854,20 @@
     0,          /*tp_as_sequence*/
     0,          /*tp_as_mapping*/
     0,          /*tp_hash*/
-    0,			/* tp_call */
-    0,			/* tp_str */
-    0,  		/* tp_getattro */
+    0,                  /* tp_call */
+    0,                  /* tp_str */
+    0,                  /* tp_getattro */
     0,          /* tp_setattro */
-    0,			/* tp_as_buffer */
+    0,                  /* tp_as_buffer */
 #if (PY_VERSION_HEX < 0x03000000)
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_WEAKREFS,      /* tp_flags */
 #else
     Py_TPFLAGS_DEFAULT,      /* tp_flags */
 #endif
     0,          /* tp_doc */
-    0,		    /* tp_traverse */
-    0,			/* tp_clear */
-    0,			/* tp_richcompare */
+    0,              /* tp_traverse */
+    0,                  /* tp_clear */
+    0,                  /* tp_richcompare */
     offsetof(DBLockObject, in_weakreflist),   /* tp_weaklistoffset */
 };
 
@@ -6893,20 +6893,20 @@
     0,          /*tp_as_sequence*/
     0,          /*tp_as_mapping*/
     0,          /*tp_hash*/
-    0,			/* tp_call */
-    0,			/* tp_str */
-    0,  		/* tp_getattro */
+    0,                  /* tp_call */
+    0,                  /* tp_str */
+    0,                  /* tp_getattro */
     0,          /* tp_setattro */
-    0,			/* tp_as_buffer */
+    0,                  /* tp_as_buffer */
 #if (PY_VERSION_HEX < 0x03000000)
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_WEAKREFS,      /* tp_flags */
 #else
     Py_TPFLAGS_DEFAULT,      /* tp_flags */
 #endif
     0,          /* tp_doc */
-    0,		    /* tp_traverse */
-    0,			/* tp_clear */
-    0,			/* tp_richcompare */
+    0,              /* tp_traverse */
+    0,                  /* tp_clear */
+    0,                  /* tp_richcompare */
     offsetof(DBSequenceObject, in_weakreflist),   /* tp_weaklistoffset */
     0,          /*tp_iter*/
     0,          /*tp_iternext*/
@@ -7068,7 +7068,7 @@
 #if (PY_VERSION_HEX < 0x03000000)
         return;
 #else
-    	return NULL;
+        return NULL;
 #endif
     }
 
@@ -7473,7 +7473,7 @@
      * using one base class. */
     PyDict_SetItemString(d, "KeyError", PyExc_KeyError);
     PyRun_String("class DBNotFoundError(DBError, KeyError): pass\n"
-	         "class DBKeyEmptyError(DBError, KeyError): pass",
+                 "class DBKeyEmptyError(DBError, KeyError): pass",
                  Py_file_input, d, d);
     DBNotFoundError = PyDict_GetItemString(d, "DBNotFoundError");
     DBKeyEmptyError = PyDict_GetItemString(d, "DBKeyEmptyError");