summaryrefslogtreecommitdiff
path: root/Include/pystate.h
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-32030: Add _PyMainInterpreterConfig.pythonhome (#4513)Victor Stinner2017-11-231-1/+4
| | | | | | | | | | | | * Py_Main() now reads the PYTHONHOME environment variable * Add _Py_GetPythonHomeWithConfig() private function * Add _PyWarnings_InitWithConfig() * init_filters() doesn't get the current core configuration from the current interpreter or Python thread anymore. Pass explicitly the configuration to _PyWarnings_InitWithConfig(). * _Py_InitializeCore() now fails on _PyWarnings_InitWithConfig() failure. * Pass configuration as constant
* bpo-32030: Move PYTHONPATH to _PyMainInterpreterConfig (#4511)Victor Stinner2017-11-231-3/+3
| | | | Move _PyCoreConfig.module_search_path_env to _PyMainInterpreterConfig structure.
* bpo-32030: Add _PyCoreConfig.module_search_path_env (#4504)Victor Stinner2017-11-231-2/+7
| | | | | | | | | | | Changes: * Py_Main() initializes _PyCoreConfig.module_search_path_env from the PYTHONPATH environment variable. * PyInterpreterState_New() now initializes core_config and config fields * Compute sys.path a little bit ealier in _Py_InitializeMainInterpreter() and new_interpreter() * Add _Py_GetPathWithConfig() private function.
* bpo-32030: Add more options to _PyCoreConfig (#4485)Victor Stinner2017-11-201-8/+12
| | | | | | Py_Main() now handles two more -X options: * -X showrefcount: new _PyCoreConfig.show_ref_count field * -X showalloccount: new _PyCoreConfig.show_alloc_count field
* bpo-32089: Fix warnings filters in dev mode (#4482)Victor Stinner2017-11-201-1/+3
| | | | | | | | | | The developer mode (-X dev) now creates all default warnings filters to order filters in the correct order to always show ResourceWarning and make BytesWarning depend on the -b option. Write a functional test to make sure that ResourceWarning is logged twice at the same location in the developer mode. Add a new 'dev_mode' field to _PyCoreConfig.
* bpo-32030: Enhance Py_Main() (#4412)Victor Stinner2017-11-151-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parse more env vars in Py_Main(): * Add more options to _PyCoreConfig: * faulthandler * tracemalloc * importtime * Move code to parse environment variables from _Py_InitializeCore() to Py_Main(). This change fixes a regression from Python 3.6: PYTHONUNBUFFERED is now read before calling pymain_init_stdio(). * _PyFaulthandler_Init() and _PyTraceMalloc_Init() now take an argument to decide if the module has to be enabled at startup. * tracemalloc_start() is now responsible to check the maximum number of frames. Other changes: * Cleanup Py_Main(): * Rename some pymain_xxx() subfunctions * Add pymain_run_python() subfunction * Cleanup Py_NewInterpreter() * _PyInterpreterState_Enable() now reports failure * init_hash_secret() now considers pyurandom() failure as an "user error": don't fail with abort(). * pymain_optlist_append() and pymain_strdup() now sets err on memory allocation failure.
* Fix trailing whitespaces in C files. (#4130)Serhiy Storchaka2017-10-261-2/+2
|
* bpo-31857: Make the behavior of USE_STACKCHECK deterministic (#4098)pdox2017-10-251-0/+2
|
* Move exc state to generator. Fixes bpo-25612 (#1773)Mark Shannon2017-10-221-3/+24
| | | Move exception state information from frame objects to coroutine (generator/thread) object where it belongs.
* bpo-30860: Fix a refleak. (#3567)Eric Snow2017-09-141-2/+0
| | | | | Resolves bpo-31420. (This was accidentally reverted when in #3565.)
* bpo-31404: Revert "remove modules from Py_InterpreterState (#1638)" (#3565)Eric Snow2017-09-131-0/+3
| | | PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
* bpo-30860: Fix a refleak. (#3506)Eric Snow2017-09-111-2/+0
| | | | | | | | | | | | | | * Drop warnoptions from PyInterpreterState. * Drop xoptions from PyInterpreterState. * Don't set warnoptions and _xoptions again. * Decref after adding to sys.__dict__. * Drop an unused macro. * Check sys.xoptions *before* we delete it.
* bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-071-14/+16
| | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* bpo-31344: Per-frame control of trace events (GH-3417)Nick Coghlan2017-09-081-1/+6
| | | | | | | | | f_trace_lines: enable/disable line trace events f_trace_opcodes: enable/disable opcode trace events These are intended primarily for testing of the interpreter itself, as they make it much easier to emulate signals arriving at unfortunate times.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-4/+0
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Revert "bpo-30860: Consolidate stateful runtime globals." (#3379)Eric Snow2017-09-051-16/+14
| | | Windows buildbots started failing due to include-related errors.
* bpo-30860: Consolidate stateful runtime globals. (#2594)Eric Snow2017-09-051-14/+16
| | | | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)Eric Snow2017-09-041-1/+0
| | | sys.modules is the one true source.
* bpo-30604: clean up co_extra support (#2144)Dino Viehland2017-06-211-3/+4
| | | bpo-30604: port fix from 3.6 dropping binary compatibility tweaks
* bpo-16500: Allow registering at-fork handlers (#1715)Antoine Pitrou2017-05-271-0/+5
| | | | | | | | | | | | * bpo-16500: Allow registering at-fork handlers * Address Serhiy's comments * Add doc for new C API * Add doc for new Python-facing function * Add NEWS entry + doc nit
* bpo-22257: Private C-API for main interpreter initialization (PEP 432). (#1729)Eric Snow2017-05-231-0/+13
| | | (patch by Nick Coghlan)
* bpo-22257: Private C-API for core runtime initialization (PEP 432). (#1772)Eric Snow2017-05-231-0/+11
| | | (patch by Nick Coghlan)
* bpo-22257: Small changes for PEP 432. (#1728)Eric Snow2017-05-221-0/+1
| | | PEP 432 specifies a number of large changes to interpreter startup code, including exposing a cleaner C-API. The major changes depend on a number of smaller changes. This patch includes all those smaller changes.
* bpo-29102: Add a unique ID to PyInterpreterState. (#1639)Eric Snow2017-05-221-0/+9
|
* bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka2017-03-231-2/+2
| | | | | | | | | | | * bpo-6532: Make the thread id an unsigned integer. From C API side the type of results of PyThread_start_new_thread() and PyThread_get_thread_ident(), the id parameter of PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState changed from "long" to "unsigned long". * Restore a check in thread_get_ident().
* Issue #26900: Excluded underscored names and other private API from limited API.Serhiy Storchaka2016-09-111-0/+10
|
* remove ceval timestamp supportBenjamin Peterson2016-09-091-3/+0
|
* Issue #28003: Implement PEP 525 -- Asynchronous Generators.Yury Selivanov2016-09-081-0/+3
|
* Add the co_extra field and accompanying APIs to code objects.Brett Cannon2016-09-071-0/+7
| | | | This completes PEP 523.
* Implement the frame evaluation API aspect of PEP 523.Brett Cannon2016-09-051-2/+5
|
* Issue #22557: Now importing already imported modules is up to 2.5 times faster.Serhiy Storchaka2016-08-021-0/+1
|
* Merge 3.5 (pystate.h)Victor Stinner2016-03-251-2/+0
|\
| * pystate.h: fix _PyThreadState_UncheckedGet()Victor Stinner2016-03-251-2/+0
| | | | | | | | Declare the function even if thread support is disabled.
* | faulthandler now works in non-Python threadsVictor Stinner2016-03-161-4/+12
| | | | | | | | | | | | | | | | | | | | | | 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/+4
|/ | | | | | | | | | | | 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()
* Add _PyThreadState_UncheckedGet()Victor Stinner2016-01-201-0/+10
| | | | | | | | | | | | | | | | | | | Issue #26154: Add a new private _PyThreadState_UncheckedGet() function which gets the current thread state, but don't call Py_FatalError() if it is NULL. Python 3.5.1 removed the _PyThreadState_Current symbol from the Python C API to no more expose complex and private atomic types. Atomic types depends on the compiler or can even depend on compiler options. The new function _PyThreadState_UncheckedGet() allows to get the variable value without having to care of the exact implementation of atomic types. Changes: * Replace direct usage of the _PyThreadState_Current variable with a call to _PyThreadState_UncheckedGet(). * In pystate.c, replace direct usage of the _PyThreadState_Current variable with the PyThreadState_GET() macro for readability. * Document also PyThreadState_Get() in pystate.h
* Issue #25150: Hide the private _Py_atomic_xxx symbols from the publicVictor Stinner2015-09-181-12/+5
| | | | | | | | | Python.h header to fix a compilation error with OpenMP. PyThreadState_GET() becomes an alias to PyThreadState_Get() to avoid ABI incompatibilies. It is important that the _PyThreadState_Current variable is always accessed with the same implementation of pyatomic.h. Use the PyThreadState_Get() function so extension modules will all reuse the same implementation.
* Issue 24342: Let wrapper set by sys.set_coroutine_wrapper fail gracefullyYury Selivanov2015-06-021-0/+1
|
* PEP 0492 -- Coroutines with async and await syntax. Issue #24017.Yury Selivanov2015-05-111-0/+2
|
* Issue #23644: Fix issues with C++ when compiling Python extensionsVictor Stinner2015-03-171-3/+7
| | | | | | | | Disable completly pyatomic.h on C++, because <stdatomic.h> is not compatible with C++. <pyatomic.h> is only needed by the optimized PyThreadState_GET() macro in pystate.h. Instead, declare PyThreadState_GET() as an alias to PyThreadState_Get(), as done for limited API.
* Issue #19255: The builtins module is restored to initial value beforeSerhiy Storchaka2014-02-101-1/+1
| | | | cleaning other modules. The sys and builtins modules are cleaned last.
* Issue #19526: Exclude all new API from the stable ABI.Martin v. Löwis2014-01-031-0/+2
|
* Close #19199: Remove ``PyThreadState.tick_counter`` fieldVictor Stinner2013-10-091-10/+0
|
* Issue #18808: Thread.join() now waits for the underlying thread state to be ↵Antoine Pitrou2013-09-071-0/+26
| | | | | | destroyed before returning. This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running.
* Issue #10241: Clear extension module dict copies at interpreter shutdown.Antoine Pitrou2013-08-111-0/+3
| | | | | | Patch by Neil Schemenauer, minimally modified. (re-apply after fix for tkinter-related crash)
* Backout 62658d9d8926 (issue #10241): it causes a crash at shutdown when ↵Antoine Pitrou2013-08-021-3/+0
| | | | deallocating a Tkapp object.
* Issue #10241: Clear extension module dict copies at interpreter shutdown.Antoine Pitrou2013-08-011-0/+3
| | | | Patch by Neil Schemenauer, minimally modified.
* Issue #17912: Use a doubly linked-list for thread states.Charles-Francois Natali2013-05-081-0/+1
|
* Issue #17094: Clear stale thread states after fork().Antoine Pitrou2013-05-051-0/+1
| | | | | | | Note that this is a potentially disruptive change since it may release some system resources which would otherwise remain perpetually alive (e.g. database connections kept in thread-local storage).
* Issue #17522: Add the PyGILState_Check() API.Kristján Valur Jónsson2013-03-231-0/+5
|