cpython/Modules/_io
Victor Stinner 7e3f09cad9
gh-99537: Use Py_SETREF() function in C code (#99656)
Fix potential race condition in code patterns:

* Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);"
* Replace "Py_XDECREF(var); var = new;" with "Py_XSETREF(var, new);"
* Replace "Py_CLEAR(var); var = new;" with "Py_XSETREF(var, new);"

Other changes:

* Replace "old = var; var = new; Py_DECREF(var)"
  with "Py_SETREF(var, new);"
* Replace "old = var; var = new; Py_XDECREF(var)"
  with "Py_XSETREF(var, new);"
* And remove the "old" variable.
2022-11-22 14:22:22 +01:00
..
clinic gh-90928: Improve static initialization of keywords tuple in AC (#95907) 2022-08-13 12:09:40 +02:00
_iomodule.c gh-99300: Use Py_NewRef() in Modules/ directory (#99467) 2022-11-14 13:08:43 +01:00
_iomodule.h bpo-46765: Replace Locally Cached Strings with Statically Initialized Objects (gh-31366) 2022-02-22 17:23:51 -07:00
bufferedio.c gh-99300: Use Py_NewRef() in Modules/ directory (#99467) 2022-11-14 13:08:43 +01:00
bytesio.c gh-99300: Use Py_NewRef() in Modules/ directory (#99467) 2022-11-14 13:08:43 +01:00
fileio.c gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537) 2022-05-12 14:48:38 +09:00
iobase.c gh-99300: Use Py_NewRef() in Modules/ directory (#99467) 2022-11-14 13:08:43 +01:00
stringio.c gh-99537: Use Py_SETREF() function in C code (#99656) 2022-11-22 14:22:22 +01:00
textio.c gh-99537: Use Py_SETREF() function in C code (#99656) 2022-11-22 14:22:22 +01:00
winconsoleio.c bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized global objects. (gh-30928) 2022-02-08 13:39:07 -07:00