/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/_static_tuple_c.c

Make StaticTuple tests pass on Python 3

Merged from https://code.launchpad.net/~gz/brz/py3_static_tuple_mismatched_types/+merge/326330

Show diffs side-by-side

added added

removed removed

Lines of Context:
428
428
    } else if (w == Py_None) {
429
429
        // None is always less than the object
430
430
        switch (op) {
431
 
        case Py_NE:case Py_GT:case Py_GE:
 
431
        case Py_NE:
 
432
#if PY_MAJOR_VERSION >= 3
 
433
#else
 
434
        case Py_GT:case Py_GE:
 
435
#endif
432
436
            Py_INCREF(Py_True);
433
437
            return Py_True;
434
 
        case Py_EQ:case Py_LT:case Py_LE:
 
438
        case Py_EQ:
 
439
#if PY_MAJOR_VERSION >= 3
 
440
#else
 
441
        case Py_LT:case Py_LE:
 
442
#endif
435
443
            Py_INCREF(Py_False);
436
444
            return Py_False;
437
 
    default: // Should never happen
438
 
        return Py_NotImplemented;
 
445
        default: // Should only happen on Python 3
 
446
            return Py_NotImplemented;
439
447
        }
440
448
    } else {
441
449
        /* We don't special case this comparison, we just let python handle
725
733
static PyObject *
726
734
StaticTuple_sizeof(StaticTuple *self)
727
735
{
728
 
        Py_ssize_t res;
 
736
    Py_ssize_t res;
729
737
 
730
 
        res = _PyObject_SIZE(&StaticTuple_Type) + (int)self->size * sizeof(void*);
731
 
        return PyInt_FromSsize_t(res);
 
738
    res = _PyObject_SIZE(&StaticTuple_Type) + (int)self->size * sizeof(void*);
 
739
    return PyInt_FromSsize_t(res);
732
740
}
733
741
 
734
742