@@ -1622,9 +1622,8 @@ _textiowrapper_writeflush(textio *self)
16221622 NOTE: this code relies on GIL / @critical_section. It needs to ensure
16231623 state is "safe" before/after calls to other Python code.
16241624
1625- In particular:
1626- _textiowrapper_writeflush() calls buffer.write(). self->pending_bytes
1627- can be appended during buffer->write() or other thread.
1625+ In particular _textiowrapper_writeflush() calls buffer.write(). That will
1626+ modify self->pending_bytes.
16281627
16291628 At the end of this function either pending_bytes needs to be NULL _or_
16301629 there needs to be an exception.
@@ -1684,7 +1683,6 @@ _textiowrapper_writeflush(textio *self)
16841683 assert (pos == self -> pending_bytes_count );
16851684 }
16861685
1687-
16881686 /* pending_bytes is now owned by this function. */
16891687 self -> pending_bytes_count = 0 ;
16901688 self -> pending_bytes = NULL ;
@@ -1760,10 +1758,10 @@ _textiowrapper_writeflush(textio *self)
17601758 Py_ssize_t size = PyNumber_AsSsize_t (ret , PyExc_OverflowError );
17611759
17621760 /* Check for unexpected return values. */
1763- /* Can't get out size follow return previous behavior . */
1761+ /* Can't get out size. */
17641762 if (size == -1 && PyErr_Occurred ()) {
17651763 /* Warn about the value, but do not error. */
1766- PyObject * exc = PyErr_GetRaisedException ()
1764+ PyObject * exc = PyErr_GetRaisedException ();
17671765 PyErr_WarnFormat (PyExc_DeprecationWarning , 1 ,
17681766 "write returned value '%s' not specified by"
17691767 " BufferedIOBase or TextIOBase (%s)" , ret , exc );
0 commit comments