summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* bpo-43268: Pass interp rather than tstate to internal functions (GH-24580)Victor Stinner2021-02-195-36/+36
| | | | | | | | | | | | | | | Pass the current interpreter (interp) rather than the current Python thread state (tstate) to internal functions which only use the interpreter. Modified functions: * _PyXXX_Fini() and _PyXXX_ClearFreeList() functions * _PyEval_SignalAsyncExc(), make_pending_calls() * _PySys_GetObject(), sys_set_object(), sys_set_object_id(), sys_set_object_str() * should_audit(), set_flags_from_config(), make_flags() * _PyAtExit_Call() * init_stdio_encoding() * etc.
* bpo-43270: Remove private _PyErr_OCCURRED() macro (GH-24579)Victor Stinner2021-02-191-6/+0
| | | | | | | | Remove the private _PyErr_OCCURRED() macro: use the public PyErr_Occurred() function instead. CPython internals must use the internal _PyErr_Occurred(tstate) function instead: it is the most efficient way to check if an exception was raised.
* bpo-43268: _Py_IsMainInterpreter() now expects interp (GH-24577)Victor Stinner2021-02-191-2/+2
| | | | The _Py_IsMainInterpreter() function now expects interp rather than tstate.
* bpo-40522: Replace PyThreadState_GET() with PyThreadState_Get() (GH-24575)Victor Stinner2021-02-192-5/+5
| | | | | Use directly the PyThreadState_Get() function in public header files, since PyThreadState_GET() macro is just an alias to it in pratice in these files.
* bpo-43268: Replace _PyThreadState_GET() with _PyInterpreterState_GET() ↵Victor Stinner2021-02-192-10/+7
| | | | | | | | | | | (GH-24576) Replace _PyThreadState_GET() with _PyInterpreterState_GET() in functions which only need the current interpreter, but don't need the current Python thread state. Replace also _PyThreadState_UncheckedGet() with _PyThreadState_GET() in faulthandler.c, since _PyThreadState_UncheckedGet() is just an alias to _PyThreadState_GET() in practice.
* bpo-42990: Refactor _PyFrame_New_NoTrack() (GH-24566)Victor Stinner2021-02-182-3/+4
| | | | | | | | | | | | * Refactor _PyFrame_New_NoTrack() and PyFunction_NewWithQualName() code. * PyFrame_New() checks for _PyEval_BuiltinsFromGlobals() failure. * Fix a ref leak in _PyEval_BuiltinsFromGlobals() error path. * Complete PyFunction_GetModule() documentation: it returns a borrowed reference and it can return NULL. * Move _PyEval_BuiltinsFromGlobals() definition to the internal C API. * PyFunction_NewWithQualName() uses _Py_IDENTIFIER() API for the "__name__" string to make it compatible with subinterpreters.
* bpo-35134: Move Include/{pyarena.h,pyctype.h} to Include/cpython/ (GH-24550)Nicholas Sim2021-02-173-2/+2
| | | | Move non-limited C API headers pyarena.h and pyctype.h into Include/cpython/ directory.
* bpo-40170: Always define PyExceptionClass_Name() as a function (GH-24553)Erlend Egeberg Aasland2021-02-171-4/+0
| | | Remove macro variant of PyExceptionClass_Name().
* bpo-40170: Always define PyIter_Check() as a function (GH-24548)Erlend Egeberg Aasland2021-02-162-7/+1
|
* bpo-35134, Include: Move pytime.h to cpython/pytime.h (GH-23988)Nicholas Sim2021-02-162-4/+1
| | | | This change is backward compatible since C extension modules must not include "pytime.h" directly, but only include "Python.h".
* bpo-40170: Convert PyDescr_IsData() to static inline function (GH-24535)Erlend Egeberg Aasland2021-02-161-1/+1
|
* bpo-43181: Convert PyObject_TypeCheck to static inline function (GH-24533)Erlend Egeberg Aasland2021-02-151-2/+5
|
* bpo-43166: Disable ceval.c optimisations for Windows debug builds (GH-24485)Steve Dower2021-02-091-3/+3
| | | | This ensures that ceval.c can be debugged. Also remove some irrelevant options from the pragma.
* bpo-35295: Remove outdated comment. (GH-24453)Inada Naoki2021-02-051-7/+0
|
* Post 3.10.0a5Pablo Galindo2021-02-031-1/+1
|
* Fix Sphynx syntax in the memory.rst documentv3.10.0a5Pablo Galindo2021-02-021-2/+2
|
* bpo-42990: Further refactoring of PyEval_ functions. (GH-24368)Mark Shannon2021-02-013-18/+7
| | | | | | | | | | * Further refactoring of PyEval_EvalCode and friends. Break into make-frame, and eval-frame parts. * Simplify function vector call using new _PyEval_Vector. * Remove unused internal functions: _PyEval_EvalCodeWithName and _PyEval_EvalCode. * Don't use legacy function PyEval_EvalCodeEx.
* bpo-43030: Fixed a compiler warning in Py_UNICODE_ISSPACE with signed ↵Serhiy Storchaka2021-01-311-1/+1
| | | | wchar_t (GH-24350)
* bpo-42990: Introduce 'frame constructor' struct to simplify API for ↵Mark Shannon2021-01-293-13/+24
| | | | | | | PyEval_CodeEval and friends (GH-24298) * Introduce 'frame constructor' to simplify API for frame creation * Embed struct using a macro to conform to PEP 7
* bpo-42979: Enhance abstract.c assertions checking slot result (GH-24352)Victor Stinner2021-01-272-1/+7
| | | | | | | | * bpo-42979: Enhance abstract.c assertions checking slot result Add _Py_CheckSlotResult() function which fails with a fatal error if a slot function succeeded with an exception set or failed with no exception set: write the slot name, the type name and the current exception (if an exception is set).
* bpo-40176: Improve error messages for unclosed string literals (GH-19346)Batuhan Taskaya2021-01-201-2/+0
| | | Automerge-Triggered-By: GH:isidentical
* bpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254)Victor Stinner2021-01-191-1/+1
|
* bpo-42923: Dump extension modules on fatal error (GH-24207)Victor Stinner2021-01-182-0/+8
| | | | | | | The Py_FatalError() function and the faulthandler module now dump the list of extension modules on a fatal error. Add _Py_DumpExtensionModules() and _PyModule_IsExtension() internal functions.
* bpo-42923: Py_FatalError() avoids fprintf() (GH-24242)Victor Stinner2021-01-181-7/+3
| | | | | * Replace buffered fprintf() with unbuffered _Py_write_noraise() in Py_FatalError(). * _Py_DumpHexadecimal() now accepts uintptr_t.
* bpo-41994: Fix refcount issues in Python/import.c (GH-22632)Serhiy Storchaka2021-01-122-7/+0
| | | https://bugs.python.org/issue41994
* bpo-42882: _PyRuntimeState_Init() leaves unicode next_index unchanged (GH-24193)Victor Stinner2021-01-121-0/+4
| | | | | | | | Fix the _PyUnicode_FromId() function (_Py_IDENTIFIER(var) API) when Py_Initialize() / Py_Finalize() is called multiple times: preserve _PyRuntime.unicode_ids.next_index value. Use _PyRuntimeState_INIT macro instead memset(0) to reset _PyRuntimeState members to zero.
* bpo-41798: Allocate _decimal extension module C API on the heap (GH-24117)Erlend Egeberg Aasland2021-01-061-1/+3
|
* bpo-42823: Fix frame lineno when frame.f_trace is set (GH-24099)Mark Shannon2021-01-051-6/+1
| | | | | | | | | * Add test for frame.f_lineno with/without tracing. * Make sure that frame.f_lineno is correct regardless of whether frame.f_trace is set. * Update importlib * Add NEWS
* Post 3.10.0a4Pablo Galindo2021-01-041-1/+1
|
* Python 3.10.0a4v3.10.0a4Pablo Galindo2021-01-041-2/+2
|
* bpo-40052: Fix alignment issue in PyVectorcall_Function() (GH-23999)Petr Viktorin2020-12-291-3/+3
| | | | | | | | | | | | | | | ``` In file included from /usr/include/python3.8/Python.h:147: In file included from /usr/include/python3.8/abstract.h:837: /usr/include/python3.8/cpython/abstract.h:91:11: error: cast from 'char *' to 'vectorcallfunc *' (aka 'struct _object *(**)(struct _object *, struct _object *const *, unsigned long, struct _object *)') increases required alignment from 1 to 8 [-Werror,-Wcast-align] ptr = (vectorcallfunc*)(((char *)callable) + offset); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` Co-Authored-By: Andreas Schneider <asn@cryptomilk.org> Co-Authored-By: Antoine Pitrou <antoine@python.org>
* bpo-40521: Per-interpreter interned strings (GH-20085)Victor Stinner2020-12-261-0/+11
| | | | | | | | | | | Make the Unicode dictionary of interned strings compatible with subinterpreters. Remove the INTERN_NAME_STRINGS macro in typeobject.c: names are always now interned (even if EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined). _PyUnicode_ClearInterned() now uses PyDict_Next() to no longer allocate memory, to ensure that the interned dictionary is cleared.
* bpo-42745: Make the type cache per-interpreter (GH-23947)Victor Stinner2020-12-263-1/+26
| | | | | | | | | | | Make the type attribute lookup cache per-interpreter. Add private _PyType_InitCache() function, called by PyInterpreterState_New(). Continue to share next_version_tag between interpreters, since static types are still shared by interpreters. Remove MCACHE macro: the cache is no longer disabled if the EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined.
* bpo-39465: Fix _PyUnicode_FromId() for subinterpreters (GH-20058)Victor Stinner2020-12-253-3/+18
| | | | | | | | | | | | | | | | | Make _PyUnicode_FromId() function compatible with subinterpreters. Each interpreter now has an array of identifier objects (interned strings decoded from UTF-8). * Add PyInterpreterState.unicode.identifiers: array of identifiers objects. * Add _PyRuntimeState.unicode_ids used to allocate unique indexes to _Py_Identifier. * Rewrite the _Py_Identifier structure. Microbenchmark on _PyUnicode_FromId(&PyId_a) with _Py_IDENTIFIER(a): [ref] 2.42 ns +- 0.00 ns -> [atomic] 3.39 ns +- 0.00 ns: 1.40x slower This change adds 1 ns per _PyUnicode_FromId() call in average.
* bpo-39465: Add pycore_atomic_funcs.h header (GH-20766)Victor Stinner2020-12-232-3/+97
| | | | | | Add pycore_atomic_funcs.h internal header file: similar to pycore_atomic.h but don't require to declare variables as atomic. Add _Py_atomic_size_get() and _Py_atomic_size_set() functions.
* bpo-42246: Make sure that `f_lasti`, and thus `f_lineno`, is set correctly ↵Mark Shannon2020-12-171-1/+1
| | | | | | | | | after raising or reraising an exception (GH-23803) * Ensure that f_lasti is set correctly after an exception is raised to conform to PEP 626. * Update importlib * Add NEWS.
* bpo-42639: Move atexit state to PyInterpreterState (GH-23763)Victor Stinner2020-12-152-4/+18
| | | | | | | | | * Add _PyAtExit_Call() function and remove pyexitfunc and pyexitmodule members of PyInterpreterState. The function logs atexit callback errors using _PyErr_WriteUnraisableMsg(). * Add _PyAtExit_Init() and _PyAtExit_Fini() functions. * Remove traverse, clear and free functions of the atexit module. Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-42639: atexit now logs callbacks exceptions (GH-23771)Victor Stinner2020-12-142-1/+3
| | | | | | | | | | | At Python exit, if a callback registered with atexit.register() fails, its exception is now logged. Previously, only some exceptions were logged, and the last exception was always silently ignored. Add _PyAtExit_Call() function and remove PyInterpreterState.atexit_func member. call_py_exitfuncs() now calls directly _PyAtExit_Call(). The atexit module must now always be built as a built-in module.
* bpo-42639: Cleanup atexitmodule.c (GH-23770)Victor Stinner2020-12-142-7/+2
| | | | | | | | | * Rename "atexitmodule_state" to "struct atexit_state". * Rename "modstate" to "state". * Rename "self" parameter to "module". * test_atexit uses textwrap.dedent(). * Remove _Py_PyAtExit() function: inline it into atexit_exec(). * PyInterpreterState: rename pyexitfunc to atexit_func, rename pyexitmodule to atexit_module.
* bpo-42591: Export missing Py_FrozenMain() symbol (GH-23730)Victor Stinner2020-12-101-0/+2
| | | | | | | Export the Py_FrozenMain() function: fix a Python 3.9.0 regression. Python 3.9 uses -fvisibility=hidden and the function was not exported explicitly and so not exported. Add also Py_FrozenMain to the stable ABI on Windows.
* bpo-32381: Add _PyRun_AnyFileObject() (GH-23723)Victor Stinner2020-12-092-0/+10
| | | | | | | | | | pymain_run_file() no longer encodes the filename: pass the filename as an object to the new _PyRun_AnyFileObject() function. Add new private functions: * _PyRun_AnyFileObject() * _PyRun_InteractiveLoopObject() * _Py_FdIsInteractive()
* bpo-32381: Remove unused _Py_fopen() function (GH-23711)Victor Stinner2020-12-091-4/+0
| | | | Remove the private _Py_fopen() function which is no longer needed. Use _Py_wfopen() or _Py_fopen_obj() instead.
* bpo-32381: Add _PyRun_SimpleFileObject() (GH-23709)Victor Stinner2020-12-081-0/+5
| | | | pymain_run_startup() now pass the filename as a Python object to _PyRun_SimpleFileObject().
* bpo-35134: Add Include/cpython/pythonrun.h file (GH-23701)Victor Stinner2020-12-082-117/+124
| | | | | Py_CompileString() is now always declared as a function by Include/pythonrun.h. It is overriden with a macro in Include/cpython/pythonrun.h.
* Post 3.10.0a3Pablo Galindo2020-12-081-1/+1
|
* Python 3.10.0a3v3.10.0a3Pablo Galindo2020-12-071-2/+2
|
* bpo-30459: Cast the result of PyCell_SET to void (GH-23654)Victor Stinner2020-12-071-1/+1
|
* bpo-30459: Cast the result of PyList_SET_ITEM() to void (GH-19975)Zackery Spytz2020-12-052-2/+2
| | | Do the same for PyTuple_SET_ITEM().
* bpo-42262: Py_NewRef() casts its argument to PyObject* (GH-23626)Victor Stinner2020-12-031-4/+2
| | | Write also unit tests on Py_NewRef() and Py_XNewRef().
* bpo-42431: Fix outdated bytes comments (GH-23458)Serhiy Storchaka2020-12-033-25/+39
| | | | Also move definitions of internal macros F_LJUST etc to private header.