summaryrefslogtreecommitdiff
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-36475: Finalize PyEval_AcquireLock() and PyEval_AcquireThread() properly ↵Joannah Nanjekye2019-04-291-12/+16
| | | | | | | | (GH-12667) PyEval_AcquireLock() and PyEval_AcquireThread() now terminate the current thread if called while the interpreter is finalizing, making them consistent with PyEval_RestoreThread(), Py_END_ALLOW_THREADS, and PyGILState_Ensure().
* Fix typo in 'tandem' word (GH-12998) (GH-12998)Andrey2019-04-281-1/+1
|
* bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)Victor Stinner2019-04-171-0/+4
| | | | | | | | | | | | | | | | | | | | Change PyAPI_FUNC(type), PyAPI_DATA(type) and PyMODINIT_FUNC macros of pyport.h when Py_BUILD_CORE_MODULE is defined. The Py_BUILD_CORE_MODULE define must be now be used to build a C extension as a dynamic library accessing Python internals: export the PyInit_xxx() function in DLL exports on Windows. Changes: * Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE now imply Py_BUILD_CORE directy in pyport.h. * ceval.c compilation now fails with an error if Py_BUILD_CORE is not defined, just to ensure that Python is build with the correct defines. * setup.py now compiles _pickle.c with Py_BUILD_CORE_MODULE define. * setup.py compiles _json.c with Py_BUILD_CORE_MODULE define, rather than Py_BUILD_CORE_BUILTIN define * PCbuild/pythoncore.vcxproj: Add Py_BUILD_CORE_BUILTIN define.
* bpo-33608: Revert "Factor out a private, per-interpreter ↵Eric Snow2019-04-121-78/+64
| | | | | _Py_AddPendingCall()." (gh-12806) This reverts commit f13c5c8b9401a9dc19e95d8b420ee100ac022208 (gh-12360).
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-04-121-64/+78
| | | | | (gh-12360) This is effectively an un-revert of #11617 and #12024 (reverted in #12159). Portions of those were merged in other PRs (with lower risk) and this represents the remainder. Note that I found 3 different bugs in the original PRs and have fixed them here.
* bpo-36370: Check for PyErr_Occurred() after PyImport_GetModule() (GH-12504)Stefan Krah2019-03-251-3/+3
|
* bpo-36333, bpo-36356: Fix _PyEval_FiniThreads() (GH-12432)Victor Stinner2019-03-191-2/+11
| | | _PyEval_FiniThreads() now free the pending lock.
* bpo-33608: Deal with pending calls relative to runtime shutdown. (gh-12246)Eric Snow2019-03-151-21/+61
|
* bpo-33608: Fix PyEval_InitThreads() warning (GH-12346)Victor Stinner2019-03-151-1/+1
| | | | | | | | The function has no return value. Fix the following warning on Windows: python\ceval.c(180): warning C4098: 'PyEval_InitThreads': 'void' function returning a value
* bpo-33608: Make sure locks in the runtime are properly re-created. (gh-12245)Eric Snow2019-03-081-39/+10
|
* bpo-33608: Minor cleanup related to pending calls. (gh-12247)Eric Snow2019-03-081-32/+48
|
* Simplify DISPATCH by hoisting eval_breaker ahead of time. (gh-12243)Eric Snow2019-03-081-2/+3
|
* Revert: bpo-33608: Factor out a private, per-interpreter ↵Victor Stinner2019-03-041-118/+82
| | | | | | | | | | | | | | | | | | | _Py_AddPendingCall(). (GH-11617) (GH-12159) * Revert "bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary). (#12003)" This reverts commit bcfa450f210074e16feb761ae5b3e966a2532fcf. * Revert "bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. (gh-12062)" This reverts commit bda918bf65a88560ec453aaba0758a9c0d49b449. * Revert "bpo-33608: Use _Py_AddPendingCall() in _PyCrossInterpreterData_Release(). (gh-12024)" This reverts commit b05b711a2cef6c6c381e01069dedac372e0b9fb2. * Revert "bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617)" This reverts commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465.
* bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. ↵Eric Snow2019-03-011-2/+3
| | | | | (gh-12062) This includes fixes to various _Py_atomic_* macros.
* bpo-36030: Add _PyTuple_FromArray() function (GH-11954)Sergey Fedoseev2019-02-251-6/+1
|
* bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)Serhiy Storchaka2019-02-251-22/+54
|
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-02-241-82/+117
| | | | | | | (GH-11617) This involves moving the global "pending calls" state to PyInterpreterState. https://bugs.python.org/issue33608
* bpo-35724: Explicitly require the main interpreter for signal-handling. ↵Eric Snow2019-02-231-1/+8
| | | | | | | (GH-11530) Ensure that the main interpreter is active (in the main thread) for signal-handling operations. This is increasingly relevant as people use subinterpreters more. https://bugs.python.org/issue35724
* bpo-12822: use monotonic clock for condvar if possible (GH-11723)Inada Naoki2019-02-201-0/+1
|
* bpo-35634: Raise an error when first passed kwargs contains duplicated keys. ↵Serhiy Storchaka2019-01-121-48/+45
| | | | (GH-11438)
* bpo-35423: Stop using the "pending calls" machinery for signals. (gh-10972)Eric Snow2019-01-111-25/+83
| | | | | This change separates the signal handling trigger in the eval loop from the "pending calls" machinery. There is no semantic change and the difference in performance is insignificant. The change makes both components less confusing. It also eliminates the risk of changes to the pending calls affecting signal handling. This is particularly relevant for some upcoming pending calls changes I have in the works.
* bpo-35454: Fix miscellaneous minor issues in error handling. (#11077)Serhiy Storchaka2018-12-111-1/+1
| | | | | | * bpo-35454: Fix miscellaneous minor issues in error handling. * Fix a null pointer dereference.
* bpo-35444: Unify and optimize the helper for getting a builtin object. ↵Serhiy Storchaka2018-12-111-0/+14
| | | | | | | | (GH-11047) This speeds up pickling of some iterators. This fixes also error handling in pickling methods when fail to look up builtin "getattr".
* bpo-35441: Remove dead and buggy code related to PyList_SetItem(). (GH-11033)Zackery Spytz2018-12-081-2/+2
| | | | | | | | | | In _localemodule.c and selectmodule.c, remove dead code that would cause double decrefs if run. In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases where a new list is populated and there is no possibility of an error. In addition, check if the list changed size in the loop in array_array_fromlist().
* bpo-35081: Add Include/internal/pycore_tupleobject.h (GH-10705)Victor Stinner2018-11-251-0/+1
| | | | Move _PyTuple_ITEMS() to a new header file: Include/internal/pycore_tupleobject.h
* bpo-35081: Add Include/internal/pycore_object.h (GH-10640)Victor Stinner2018-11-211-0/+1
| | | | Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from Include/objimpl.h to Include/internal/pycore_object.h.
* bpo-35081: Rename internal headers (GH-10275)Victor Stinner2018-11-121-1/+1
| | | | | | | | | | | | | | Rename Include/internal/ headers: * pycore_hash.h -> pycore_pyhash.h * pycore_lifecycle.h -> pycore_pylifecycle.h * pycore_mem.h -> pycore_pymem.h * pycore_state.h -> pycore_pystate.h Add missing headers to Makefile.pre.in and PCbuild: * pycore_condvar.h. * pycore_hamt.h * pycore_pyhash.h
* bpo-35199: Add an internal _PyTuple_ITEMS() macro (GH-10434)Victor Stinner2018-11-091-1/+1
| | | | | | | * _PyTuple_ITEMS() gives access to the tuple->ob_item field and cast the first argument to PyTupleObject*. This internal macro is only usable if Py_BUILD_CORE is defined. * Replace &PyTuple_GET_ITEM(ob, 0) with _PyTuple_ITEMS(ob). * Replace PyTuple_GET_ITEM(op, 1) with &_PyTuple_ITEMS(ob)[1].
* bpo-35081: Add _PyThreadState_GET() internal macro (GH-10266)Victor Stinner2018-11-011-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | If Py_BUILD_CORE is defined, the PyThreadState_GET() macro access _PyRuntime which comes from the internal pycore_state.h header. Public headers must not require internal headers. Move PyThreadState_GET() and _PyInterpreterState_GET_UNSAFE() from Include/pystate.h to Include/internal/pycore_state.h, and rename PyThreadState_GET() to _PyThreadState_GET() there. The PyThreadState_GET() macro of pystate.h is now redefined when pycore_state.h is included, to use the fast _PyThreadState_GET(). Changes: * Add _PyThreadState_GET() macro * Replace "PyThreadState_GET()->interp" with _PyInterpreterState_GET_UNSAFE() * Replace PyThreadState_GET() with _PyThreadState_GET() in internal C files (compiled with Py_BUILD_CORE defined), but keep PyThreadState_GET() in the public header files. * _testcapimodule.c: replace PyThreadState_GET() with PyThreadState_Get(); the module is not compiled with Py_BUILD_CORE defined. * pycore_state.h now requires Py_BUILD_CORE to be defined.
* bpo-35081: Add pycore_ prefix to internal header files (GH-10263)Victor Stinner2018-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | * Rename Include/internal/ header files: * pyatomic.h -> pycore_atomic.h * ceval.h -> pycore_ceval.h * condvar.h -> pycore_condvar.h * context.h -> pycore_context.h * pygetopt.h -> pycore_getopt.h * gil.h -> pycore_gil.h * hamt.h -> pycore_hamt.h * hash.h -> pycore_hash.h * mem.h -> pycore_mem.h * pystate.h -> pycore_state.h * warnings.h -> pycore_warnings.h * PCbuild project, Makefile.pre.in, Modules/Setup: add the Include/internal/ directory to the search paths of header files. * Update includes. For example, replace #include "internal/mem.h" with #include "pycore_mem.h".
* bpo-35081: Cleanup pystate.c and pystate.h (GH-10240)Victor Stinner2018-10-301-2/+1
| | | | | | | | | | | | * Remove _PyThreadState_Current * Replace GET_TSTATE() with PyThreadState_GET() * Replace GET_INTERP_STATE() with _PyInterpreterState_GET_UNSAFE() * Replace direct access to _PyThreadState_Current with PyThreadState_GET() * Replace _PyThreadState_Current with _PyRuntime.gilstate.tstate_current * Rename SET_TSTATE() to _PyThreadState_SET(), name more consistent with _PyThreadState_GET() * Update outdated comments
* Fix typos in comments (GH-9905)Quan Tian2018-10-191-1/+1
|
* bpo-31370: Remove references to threadless builds (#8805)Zackery Spytz2018-09-291-5/+1
| | | Support for threadless builds was removed in a6a4dc81.
* bpo-34125: Enable profiling of method_descriptor in all cases (GH-8416)jdemeyer2018-09-191-3/+27
| | | | | | `list.append([], None)` was profiled but `list.append([], None, **{})` was not profiled. Enable profiling for later case. https://bugs.python.org/issue34125
* closes bpo-34673: Tweaks to make ceval more editable. (GH-9289)Benjamin Peterson2018-09-161-136/+136
| | | | | Two major changes: - Move case statements out of the TARGET macro. - Move PREDICT macro invocations after the case label.
* bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592)Victor Stinner2018-08-031-5/+5
| | | | sys_setcheckinterval() now uses a local variable to parse arguments, before writing into interp->check_interval.
* bpo-34113: Fix a crash when using LLTRACE is on (GH-8517)costypetrisor2018-07-311-17/+27
| | | Fix a crash on negative STACKADJ() when Low-Level trace (LLTRACE) is enabled.
* bpo-34190: Fix reference leak in call_function() (GH-8413)jdemeyer2018-07-231-5/+8
|
* bpo-34126: Fix crashes while profiling invalid calls. (GH-8300)jdemeyer2018-07-211-4/+10
|
* bpo-34066: Disabled interruption before SETUP_WITH and BEFORE_ASYNC_WITH. ↵Serhiy Storchaka2018-07-091-4/+11
| | | | | | | (GH-8159) This will prevent emitting a resource warning when the execution was interrupted by Ctrl-C between calling open() and entering a 'with' block in "with open()".
* bpo-29673: fix gdb scripts pystack and pystackv (GH-6126)Marcel Plch2018-04-061-1/+1
|
* bpo-29922: Improve error messages in 'async with' (GH-6352)Serhiy Storchaka2018-04-031-0/+25
| | | when __aenter__() or __aexit__() return non-awaitable object.
* bpo-32932: More revealing error message when non-str objects in __all__ ↵Xiang Zhang2018-03-241-1/+27
| | | | (GH-5848)
* bpo-33041: Rework compiling an "async for" loop. (#6142)Serhiy Storchaka2018-03-231-0/+20
| | | | | | | | * Added new opcode END_ASYNC_FOR. * Setting global StopAsyncIteration no longer breaks "async for" loops. * Jumping into an "async for" loop is now disabled. * Jumping out of an "async for" loop no longer corrupts the stack. * Simplify the compiler.
* bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter ↵Serhiy Storchaka2018-02-221-189/+180
| | | | | | | | | to compiler. (GH-5006) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-32550. Remove the STORE_ANNOTATION bytecode. (GH-5181)Mark Shannon2018-01-291-55/+0
|
* bpo-20891: Py_Initialize() now creates the GIL (#4700)Victor Stinner2018-01-291-12/+13
| | | | The GIL is no longer created "on demand" to fix a race condition when PyGILState_Ensure() is called in a non-Python thread.
* bpo-32688: Make why the line is commented out clear (GH-5405)Xiang Zhang2018-01-291-1/+1
|
* bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code ↵Serhiy Storchaka2018-01-251-12/+10
| | | | | (GH-5222) Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
* bpo-32591: Add native coroutine origin tracking (#5250)Nathaniel J. Smith2018-01-211-0/+15
| | | | | | * Add coro.cr_origin and sys.set_coroutine_origin_tracking_depth * Use coroutine origin information in the unawaited coroutine warning * Stop using set_coroutine_wrapper in asyncio debug mode * In BaseEventLoop.set_debug, enable debugging in the correct thread