|
5 | 5 | #include "pycore_bytes_methods.h" |
6 | 6 | #include "pycore_bytesobject.h" |
7 | 7 | #include "pycore_ceval.h" // _PyEval_GetBuiltin() |
8 | | -#include "pycore_critical_section.h" |
9 | 8 | #include "pycore_object.h" // _PyObject_GC_UNTRACK() |
10 | 9 | #include "pycore_strhex.h" // _Py_strhex_with_sep() |
11 | 10 | #include "pycore_long.h" // _PyLong_FromUnsignedChar() |
@@ -2530,14 +2529,12 @@ bytearrayiter_next(PyObject *self) |
2530 | 2529 | PyByteArrayObject *seq = it->it_seq; |
2531 | 2530 | assert(PyByteArray_Check(seq)); |
2532 | 2531 |
|
2533 | | - Py_BEGIN_CRITICAL_SECTION(seq); |
2534 | 2532 | if (index < PyByteArray_GET_SIZE(seq)) { |
2535 | 2533 | val = (unsigned char)PyByteArray_AS_STRING(seq)[index]; |
2536 | 2534 | } |
2537 | 2535 | else { |
2538 | 2536 | val = -1; |
2539 | 2537 | } |
2540 | | - Py_END_CRITICAL_SECTION(); |
2541 | 2538 |
|
2542 | 2539 | if (val == -1) { |
2543 | 2540 | FT_ATOMIC_STORE_SSIZE_RELAXED(it->it_index, -1); |
@@ -2581,11 +2578,9 @@ bytearrayiter_reduce(PyObject *self, PyObject *Py_UNUSED(ignored)) |
2581 | 2578 | PyObject *ret = NULL; |
2582 | 2579 | Py_ssize_t index = FT_ATOMIC_LOAD_SSIZE_RELAXED(it->it_index); |
2583 | 2580 | if (index >= 0) { |
2584 | | - Py_BEGIN_CRITICAL_SECTION(it->it_seq); |
2585 | 2581 | if (index <= PyByteArray_GET_SIZE(it->it_seq)) { |
2586 | 2582 | ret = Py_BuildValue("N(O)n", iter, it->it_seq, index); |
2587 | 2583 | } |
2588 | | - Py_END_CRITICAL_SECTION(); |
2589 | 2584 | } |
2590 | 2585 | if (ret == NULL) { |
2591 | 2586 | ret = Py_BuildValue("N(())", iter); |
|
0 commit comments