Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-35713: Reorganize sys module initialization #11658

Merged
merged 1 commit into from
Jan 23, 2019
Merged

bpo-35713: Reorganize sys module initialization #11658

merged 1 commit into from
Jan 23, 2019

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jan 23, 2019

Reorganize Python initialization to get working exceptions and
sys.stderr earlier. Changes:

  • Add _PySys_SetPreliminaryStderr(). Preliminary sys.stderr is now
    set earlier to get an usable sys.stderr ealier.
  • Split _PyExc_Init(): create a new _PyBuiltins_AddExceptions()
    function.
  • Call _PyExc_Init() earlier in _Py_InitializeCore_impl()
    and new_interpreter() to get working exceptions earlier.
  • Split _Py_InitializeCore_impl() into subfunctions: add multiple
    pycore_init_xxx() functions
  • Move code into _Py_Initialize_ReconfigureCore() to be able to call
    it from _Py_InitializeCore().
  • Rename _Py_ReadyTypes() to _PyTypes_Init(). It now returns
    _PyInitError rather than calling Py_FatalError().
  • Rename _PySys_BeginInit() to _PySys_InitCore()
  • Rename _PySys_EndInit() to _PySys_InitMain()
  • Add _PySys_Create(). It calls _PySys_InitCore() which becomes
    private.
  • Misc code cleanup

https://bugs.python.org/issue35713

Reorganize Python initialization to get working exceptions and
sys.stderr earlier. Changes:

* Add _PySys_SetPreliminaryStderr(). Preliminary sys.stderr is now
  set earlier to get an usable sys.stderr ealier.
* Split _PyExc_Init(): create a new _PyBuiltins_AddExceptions()
  function.
* Call _PyExc_Init() earlier in _Py_InitializeCore_impl()
  and new_interpreter() to get working exceptions earlier.
* Split _Py_InitializeCore_impl() into subfunctions: add multiple
  pycore_init_xxx() functions
* Move code into _Py_Initialize_ReconfigureCore() to be able to call
  it from _Py_InitializeCore().
* Rename _Py_ReadyTypes() to _PyTypes_Init().
* Rename _PySys_BeginInit() to _PySys_InitCore()
* Rename _PySys_EndInit() to _PySys_InitMain()
* Add _PySys_Create(). It calls _PySys_InitCore() which becomes
  private.
* Misc code cleanup
@vstinner
Copy link
Member Author

PR rebased on master (to include commit 6d43f6f).

@vstinner vstinner merged commit ab67281 into python:master Jan 23, 2019
@vstinner vstinner deleted the split_sys_init branch January 23, 2019 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants