~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Modules/_bsddb.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
#include "bsddb.h"
96
96
#undef COMPILING_BSDDB_C
97
97
 
98
 
static char *rcs_id = "$Id: _bsddb.c 66568 2008-09-23 18:54:08Z jesus.cea $";
 
98
static char *rcs_id = "$Id: _bsddb.c 78564 2010-03-01 21:08:21Z florent.xicluna $";
99
99
 
100
100
/* --------------------------------------------------------------------- */
101
101
/* Various macro definitions */
2382
2382
 
2383
2383
        args = BuildValue_SS(leftKey->data, leftKey->size, rightKey->data, rightKey->size);
2384
2384
        if (args != NULL) {
2385
 
                /* XXX(twouters) I highly doubt this INCREF is correct */
2386
 
                Py_INCREF(self);
2387
2385
                result = PyEval_CallObject(self->btCompareCallback, args);
2388
2386
        }
2389
2387
        if (args == NULL || result == NULL) {
2432
2430
    if (result == NULL)
2433
2431
        return NULL;
2434
2432
    if (!NUMBER_Check(result)) {
 
2433
        Py_DECREF(result);
2435
2434
        PyErr_SetString(PyExc_TypeError,
2436
2435
                        "callback MUST return an int");
2437
2436
        return NULL;
2438
2437
    } else if (NUMBER_AsLong(result) != 0) {
 
2438
        Py_DECREF(result);
2439
2439
        PyErr_SetString(PyExc_TypeError,
2440
2440
                        "callback failed to return 0 on two empty strings");
2441
2441
        return NULL;
5776
5776
            free(listp);
5777
5777
            return NULL;
5778
5778
        }
 
5779
        Py_DECREF(key);
 
5780
        Py_DECREF(tuple);
5779
5781
    }
5780
5782
    free(listp);
5781
5783
    return stats;
7578
7580
    return PyInit__bsddb();   /* Note the two underscores */
7579
7581
#endif
7580
7582
}
7581