diff options
author | Thomas Wouters <thomas@python.org> | 2006-04-21 11:26:56 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2006-04-21 11:26:56 (GMT) |
commit | 4e908107b04b0f4dc64cca89d4a20819e0987620 (patch) | |
tree | cc26524b1ec49f7b136802a36786348f95db5093 /Objects/typeobject.c | |
parent | 64ed043c9ada5be6c9a74c72e18f8fd14d696a30 (diff) | |
download | cpython-4e908107b04b0f4dc64cca89d4a20819e0987620.zip cpython-4e908107b04b0f4dc64cca89d4a20819e0987620.tar.gz cpython-4e908107b04b0f4dc64cca89d4a20819e0987620.tar.bz2 |
Fix variable/format-char discrepancy in new-style class __getitem__,
__delitem__, __setslice__ and __delslice__ hooks. This caused test_weakref
and test_userlist to fail in the p3yk branch (where UserList, like all
classes, is new-style) on amd64 systems, with open-ended slices: the
sys.maxint value for empty-endpoint was transformed into -1.
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r-- | Objects/typeobject.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 8d2bf8c..0905d19 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4186,10 +4186,10 @@ slot_sq_ass_item(PyObject *self, Py_ssize_t index, PyObject *value) if (value == NULL) res = call_method(self, "__delitem__", &delitem_str, - "(i)", index); + "(n)", index); else res = call_method(self, "__setitem__", &setitem_str, - "(iO)", index, value); + "(nO)", index, value); if (res == NULL) return -1; Py_DECREF(res); @@ -4204,10 +4204,10 @@ slot_sq_ass_slice(PyObject *self, Py_ssize_t i, Py_ssize_t j, PyObject *value) if (value == NULL) res = call_method(self, "__delslice__", &delslice_str, - "(ii)", i, j); + "(nn)", i, j); else res = call_method(self, "__setslice__", &setslice_str, - "(iiO)", i, j, value); + "(nnO)", i, j, value); if (res == NULL) return -1; Py_DECREF(res); |