/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

Port to Python 3.10: Set static tuple reference count using Py_SET_REFCNT() rather than using Py_REFCNT().

Merged from https://code.launchpad.net/~jelmer/brz/python3.10/+merge/394195

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
    self->flags |= STATIC_TUPLE_INTERNED_FLAG;
98
98
    // The two references in the dict do not count, so that the StaticTuple
99
99
    // object does not become immortal just because it was interned.
100
 
    Py_REFCNT(self) -= 1;
 
100
    Py_SET_REFCNT(self, Py_REFCNT(self) - 1);
101
101
    return self;
102
102
}
103
103
 
116
116
 
117
117
    if (_StaticTuple_is_interned(self)) {
118
118
        /* revive dead object temporarily for Discard */
119
 
        Py_REFCNT(self) = 2;
 
119
        Py_SET_REFCNT(self, 2);
120
120
        if (SimpleSet_Discard(_interned_tuples, (PyObject*)self) != 1)
121
121
            Py_FatalError("deletion of interned StaticTuple failed");
122
122
        self->flags &= ~STATIC_TUPLE_INTERNED_FLAG;