diff options
author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2019-09-09 16:28:34 (GMT) |
---|---|---|
committer | T. Wouters <thomas@python.org> | 2019-09-09 16:28:34 (GMT) |
commit | 92709a263e9cec0bc646ccc1ea051fc528800d8d (patch) | |
tree | 50dfa3690e7112d46de23e0f372f4c427304774d /Objects | |
parent | 915cd3f0696cb8a7206754a8fc34d4cd865a1b4a (diff) | |
download | cpython-92709a263e9cec0bc646ccc1ea051fc528800d8d.zip cpython-92709a263e9cec0bc646ccc1ea051fc528800d8d.tar.gz cpython-92709a263e9cec0bc646ccc1ea051fc528800d8d.tar.bz2 |
bpo-37840: Fix handling of negative indices in bytearray_getitem() (GH-15250)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/bytearrayobject.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 8c16cc6..c9bf11b 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -381,8 +381,6 @@ bytearray_irepeat(PyByteArrayObject *self, Py_ssize_t count) static PyObject * bytearray_getitem(PyByteArrayObject *self, Py_ssize_t i) { - if (i < 0) - i += Py_SIZE(self); if (i < 0 || i >= Py_SIZE(self)) { PyErr_SetString(PyExc_IndexError, "bytearray index out of range"); return NULL; |