]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-35713: Rework Python initialization (GH-11647)
authorVictor Stinner <vstinner@redhat.com>
Tue, 22 Jan 2019 16:39:03 +0000 (17:39 +0100)
committerGitHub <noreply@github.com>
Tue, 22 Jan 2019 16:39:03 +0000 (17:39 +0100)
commitbf4ac2d2fd520c61306b2676db488adab9b5d8c5
tree36b7680e9ac88256ba0f3beeb834c677a20914f8
parent35ca1820e19f81f69073f294503cdcd708fe490f
bpo-35713: Rework Python initialization (GH-11647)

* The PyByteArray_Init() and PyByteArray_Fini() functions have been
  removed. They did nothing since Python 2.7.4 and Python 3.2.0, were
  excluded from the limited API (stable ABI), and were not
  documented.
* Move "_PyXXX_Init()" and "_PyXXX_Fini()" declarations from
  Include/cpython/pylifecycle.h to
  Include/internal/pycore_pylifecycle.h. Replace
  "PyAPI_FUNC(TYPE)" with "extern TYPE".
* _PyExc_Init() now returns an error on failure rather than calling
  Py_FatalError(). Move macros inside _PyExc_Init() and undefine them
  when done. Rewrite macros to make them look more like statement:
  add ";" when using them, add "do { ... } while (0)".
* _PyUnicode_Init() now returns a _PyInitError error rather than call
  Py_FatalError().
* Move stdin check from _PySys_BeginInit() to init_sys_streams().
* _Py_ReadyTypes() now returns a _PyInitError error rather than
  calling Py_FatalError().
Doc/whatsnew/3.8.rst
Include/cpython/pylifecycle.h
Include/internal/pycore_pylifecycle.h
Misc/NEWS.d/next/C API/2019-01-22-17-04-10.bpo-35713.fmehdG.rst [new file with mode: 0644]
Objects/bytearrayobject.c
Objects/exceptions.c
Objects/unicodeobject.c
Python/pylifecycle.c
Python/sysmodule.c