summaryrefslogtreecommitdiffstats
path: root/Python/pylifecycle.c
Commit message (Collapse)AuthorAgeFilesLines
* Py_FatalError: disable faulthandler earlierVictor Stinner2016-03-161-5/+5
| | | | | Issue #26563: Py_FatalError: disable faulthandler before trying to flush sys.stdout and sys.stderr.
* faulthandler now works in non-Python threadsVictor Stinner2016-03-161-15/+1
| | | | | | | | | | | Issue #26563: * Add _PyGILState_GetInterpreterStateUnsafe() function: the single PyInterpreterState used by this process' GILState implementation. * Enhance _Py_DumpTracebackThreads() to retrieve the interpreter state from autoInterpreterState in last resort. The function now accepts NULL for interp and current_tstate parameters. * test_faulthandler: fix a ResourceWarning when test is interrupted by CTRL+c
* Add more checks on the GILVictor Stinner2016-03-141-0/+5
| | | | | | | | | | | | Issue #10915, #15751, #26558: * PyGILState_Check() now returns 1 (success) before the creation of the GIL and after the destruction of the GIL. It allows to use the function early in Python initialization and late in Python finalization. * Add a flag to disable PyGILState_Check(). Disable PyGILState_Check() when Py_NewInterpreter() is called * Add assert(PyGILState_Check()) to: _Py_dup(), _Py_fstat(), _Py_read() and _Py_write()
* Fix Py_FatalError() if called without the GILVictor Stinner2016-03-141-34/+50
| | | | | | Issue #26558: If Py_FatalError() is called without the GIL, don't try to print the current exception, nor try to flush stdout and stderr: only dump the traceback of Python threads.
* Add PYTHONMALLOC env varVictor Stinner2016-03-141-3/+6
| | | | | | | | | | | | | Issue #26516: * Add PYTHONMALLOC environment variable to set the Python memory allocators and/or install debug hooks. * PyMem_SetupDebugHooks() can now also be used on Python compiled in release mode. * The PYTHONMALLOCSTATS environment variable can now also be used on Python compiled in release mode. It now has no effect if set to an empty string. * In debug mode, debug hooks are now also installed on Python memory allocators when Python is configured without pymalloc.
* Fix indentation of continuation lines.Georg Brandl2016-01-181-1/+1
|
* Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka2015-12-251-2/+2
| | | | private functions.
* Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failureMartin Panter2015-11-301-15/+37
|
* Issue #18174: Explain why is_valid_fd() uses dup() instead of fstat()Victor Stinner2015-09-291-0/+3
|
* Issue #25160: Fix import_init() comments and messagesVictor Stinner2015-09-181-3/+4
| | | | import_init() imports the "_imp" module, not the "imp" module.
* Merge 3.4 (create_stdio)Victor Stinner2015-09-041-42/+37
|
* Remove redundant check for tb != NULL to shut up Coverity . It has been set ↵Christian Heimes2015-04-161-1/+1
| | | | | | | to Py_None a couple of lines earlier. CID 1291697 (#1 of 1): Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking tb suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
* Issue #23524: Replace _PyVerify_fd function with calls to ↵Steve Dower2015-04-121-4/+5
| | | | _set_thread_local_invalid_parameter_handler.
* fix building without threads (closes #23877)Benjamin Peterson2015-04-061-0/+4
|
* Issue #22117: Add a new _PyTime_FromSeconds() functionVictor Stinner2015-04-031-3/+3
| | | | | Fix also _Py_InitializeEx_Private(): initialize time before initializing import, import_init() uses the _PyTime API (for thread locks).
* (Merge 3.4) Issue #23571: Fix reentrant call to Py_FatalError()Victor Stinner2015-03-251-17/+28
| | | | | | Flushing sys.stdout and sys.stderr in Py_FatalError() can call again Py_FatalError(). Add a reentrant flag to detect this case and just abort at the second call.
* (Merge 3.4) Issue #23571: Py_FatalError() now tries to flush sys.stdout andVictor Stinner2015-03-241-4/+26
| | | | | | | sys.stderr It should help to see exceptions when stderr if buffered: PyErr_Display() calls sys.stderr.write(), it doesn't write into stderr file descriptor directly.
* (Merge 3.4) Issue #23571: Enhance Py_FatalError()Victor Stinner2015-03-241-13/+59
| | | | | | | | | * Display the current Python stack if an exception was raised but the exception has no traceback * Disable faulthandler if an exception was raised (before it was only disabled if no exception was raised) * To display the current Python stack, call PyGILState_GetThisThreadState() which works even if the GIL was released
* Fixed few compiler warnings.Serhiy Storchaka2015-02-161-1/+1
|
* Closes #22869: Move PyOS_CheckStack back to pythonrun.cZachary Ware2014-11-221-38/+0
|
* Issue #22869: Split pythonrun into two modulesNick Coghlan2014-11-201-0/+1540
- interpreter startup and shutdown code moved to a new pylifecycle.c module - Py_OptimizeFlag moved into the new module with the other global flags