summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45919: Remove out of date comment (GH-30090)Dong-hee Na2021-12-141-2/+4
|
* bpo-45953: Statically initialize the small ints. (gh-30092)Eric Snow2021-12-141-2/+0
| | | | | | | The array of small PyLong objects has been statically declared. Here I also statically initialize them. Consequently they are no longer initialized dynamically during runtime init. I've also moved them under a new sub-struct in _PyRuntimeState, in preparation for static allocation and initialization of other global objects. https://bugs.python.org/issue45953
* bpo-45919: Use WinAPI GetFileType() in is_valid_fd() (GH-30082)Dong-hee Na2021-12-131-12/+10
|
* bpo-45855: Replaced deprecated `PyImport_ImportModuleNoBlock` with ↵Kumar Aditya2021-12-122-2/+2
| | | | PyImport_ImportModule (GH-30046)
* bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059)Pablo Galindo Salgado2021-12-111-60/+83
|
* bpo-37971: fix the position of decorator application (GH-30027)Carl Friedrich Bolz-Tereick2021-12-101-8/+25
| | | | | | | The line numbers of actually calling the decorator functions of functions and classes was wrong (as opposed to loading them, were they have been correct previously too). Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-45635: refactor print_exception_recursive into smaller functions to ↵Irit Katriel2021-12-101-149/+187
| | | | | standardize error handling (GH-30015) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-45654: No need to freeze types (GH-30028)Christian Heimes2021-12-101-3/+0
|
* bpo-45582: Fix test_embed failure during a PGO build on Windows (GH-30014)neonene2021-12-101-0/+2
| | | This defines VPATH differently in PGO instrumentation builds, to account for a different default output directory. It also adds sys._vpath on Windows to make the value available to sysconfig so that it can be used in tests.
* bpo-43931: Export Python version as API data (GH-25577)Gabriele N. Tornetta2021-12-101-0/+3
| | | | | When Python is embedded in other applications, it is not easy to determine which version of Python is being used. This change exposes the Python version as part of the API data. Tools like Austin (https://github.com/P403n1x87/austin) can benefit from this data when targeting applications like uWSGI, as the Python version can then be inferred systematically by looking at the exported symbols rather than relying on unreliable pattern matching or other hacks (like remote code execution etc...). Automerge-Triggered-By: GH:pablogsal
* bpo-46008: Make runtime-global object/type lifecycle functions and state ↵Eric Snow2021-12-094-51/+100
| | | | | | | | | | | | consistent. (gh-29998) This change is strictly renames and moving code around. It helps in the following ways: * ensures type-related init functions focus strictly on one of the three aspects (state, objects, types) * passes in PyInterpreterState * to all those functions, simplifying work on moving types/objects/state to the interpreter * consistent naming conventions help make what's going on more clear * keeping API related to a type in the corresponding header file makes it more obvious where to look for it https://bugs.python.org/issue46008
* bpo-45654: Freeze the runpy module and stuff it imports (GH-29903)Kumar Aditya2021-12-091-0/+14
|
* bpo-45635: continue refactor of print_exception() to standardize error ↵Irit Katriel2021-12-091-78/+105
| | | | | handling (GH-29996) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-45510: Check both types when specializing subtraction (GH-29995)Brandt Bucher2021-12-091-0/+4
|
* bpo-45711: Remove unnecessary normalization of exc_info (GH-29922)Irit Katriel2021-12-081-20/+0
|
* bpo-45635: refactor print_exception() into smaller functions (GH-29981)Irit Katriel2021-12-081-87/+139
| | | Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-46009: Do not exhaust generator when send() method raises (GH-29986)Mark Shannon2021-12-081-18/+2
|
* bpo-46008: Move Py*State init into distinct functions. (gh-29977)Eric Snow2021-12-081-101/+272
| | | | | Previously, basic initialization of PyInterprterState happened in PyInterpreterState_New() (along with allocation and adding the new interpreter to the runtime state). This prevented us from initializing interpreter states that were allocated separately (e.g. statically or in a free list). We've addressed that here by factoring out a separate function just for initialization. We've done the same for PyThreadState. _PyRuntimeState was sorted out when we added it since _PyRuntime is statically allocated. However, here we update the existing init code to line up with the functions for PyInterpreterState and PyThreadState. https://bugs.python.org/issue46008
* bpo-46008: Add _PyInterpreterState_Main(). (gh-29978)Eric Snow2021-12-082-2/+2
| | | | | PyInterpreterState_Main() is a plain function exposed in the public C-API. For internal usage we can take the more efficient approach in this PR. https://bugs.python.org/issue46008
* bpo-46008: Stop calling _PyThreadState_Init() in new_threadstate(). (gh-29973)Eric Snow2021-12-081-7/+13
| | | | | This simplifies new_threadstate(). We also rename _PyThreadState_Init() to _PyThreadState_SetCurrent() to reflect what it actually does. https://bugs.python.org/issue46008
* bpo-46008: Use PyMem_RawCalloc() to allocate PyThreadState. (GH-29972)Eric Snow2021-12-071-38/+2
| | | | | Doing so allows us to stop assigning various fields to `NULL` and 0. It also more closely matches the behavior of a static initializer. Automerge-Triggered-By: GH:ericsnowcurrently
* bpo-46008: Move thread-related interpreter state into a sub-struct. (gh-29971)Eric Snow2021-12-076-25/+25
| | | | | This parallels _PyRuntimeState.interpreters. Doing this helps make it more clear what part of PyInterpreterState relates to its threads. https://bugs.python.org/issue46008
* bpo-46008: Return void from _PyEval_InitState(). (gh-29970)Eric Snow2021-12-072-9/+6
| | | | | This falls into the category of keep-allocation-and-initialization separate. It also allows us to use _PyEval_InitState() safely in functions that return void. https://bugs.python.org/issue46008
* Fix leak when an exception is raised during generator creation. (GH-29960)Mark Shannon2021-12-071-20/+7
|
* bpo-45635: standardize error handling in traceback.c (GH-29905)Irit Katriel2021-12-071-66/+104
| | | Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-45947: Place dict and values pointer at fixed (negative) offset just ↵Mark Shannon2021-12-073-79/+46
| | | | | | | | | | | | | | | | | | | before GC header. (GH-29879) * Place __dict__ immediately before GC header for plain Python objects. * Fix up lazy dict creation logic to use managed dict pointers. * Manage values pointer, placing them directly before managed dict pointers. * Convert hint-based load/store attr specialization target managed dict classes. * Specialize LOAD_METHOD for managed dict objects. * Remove unsafe _PyObject_GC_Calloc function. * Remove unsafe _PyObject_GC_Malloc() function. * Add comment explaning use of Py_TPFLAGS_MANAGED_DICT.
* Revert "bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)" ↵Victor Stinner2021-12-071-0/+3
| | | | | (GH-29951) This reverts commit 9bf2cbc4c498812e14f20d86acb61c53928a5a57.
* bpo-45963: Make space for the InterpreterFrame of a generator in that ↵Mark Shannon2021-12-062-42/+17
| | | | | | | generator. (GH-29891) * Make generator, coroutine and async gen structs all the same size. * Store interpreter frame in generator (and coroutine). Reduces the number of allocations neeeded for a generator from two to one.
* Delete orphaned comment (#29917)Guido van Rossum2021-12-051-5/+0
| | | (The function this described was deleted by PR #23743, the comment was accidentally retained.)
* bpo-45607: Make it possible to enrich exception displays via setting their ↵Irit Katriel2021-12-031-0/+35
| | | | __note__ field (GH-29880)
* bpo-45950: Introduce Bootstrap Python again (#29859)Christian Heimes2021-12-031-45/+0
| | | | | | | | | The build system now uses a :program:`_bootstrap_python` interpreter for freezing and deepfreezing again. To speed up build process the build tools :program:`_bootstrap_python` and :program:`_freeze_module` are no longer build with LTO. Cross building depends on a build Python interpreter, which must have same version and bytecode as target host Python.
* bpo-45885: Specialize COMPARE_OP (GH-29734)Dennis Sweeney2021-12-033-23/+224
| | | | | | | * Add COMPARE_OP_ADAPTIVE adaptive instruction. * Add COMPARE_OP_FLOAT_JUMP, COMPARE_OP_INT_JUMP and COMPARE_OP_STR_JUMP specialized instructions. * Introduce and use _PyUnicode_Equal
* bpo-45582: Port getpath[p].c to Python (GH-29041)Steve Dower2021-12-035-803/+354
| | | | | The getpath.py file is frozen at build time and executed as code over a namespace. It is never imported, nor is it meant to be importable or reusable. However, it should be easier to read, modify, and patch than the previous code. This commit attempts to preserve every previously tested quirk, but these may be changed in the future to better align platforms.
* bpo-40280: Optimize ints and and startup on wasm (GH-29887)Christian Heimes2021-12-021-1/+5
|
* bpo-45954: Rename PyConfig.no_debug_ranges to code_debug_ranges (GH-29886)Victor Stinner2021-12-021-5/+6
| | | | | | | Rename PyConfig.no_debug_ranges to PyConfig.code_debug_ranges and invert the value. Document -X no_debug_ranges and PYTHONNODEBUGRANGES env var in PyConfig.code_debug_ranges documentation.
* bpo-45753: Interpreter internal tweaks (GH-29575)Mark Shannon2021-12-011-139/+194
| | | | | | | | | | * Split exit paths into exceptional and non-exceptional. * Move exit tracing code to individual bytecodes. * Wrap all trace entry and exit events in macros to make them clearer and easier to enhance. * Move return sequence into RETURN_VALUE, YIELD_VALUE and YIELD_FROM. Distinguish between normal trace events and dtrace events.
* bpo-45711: Change exc_info related APIs to derive type and traceback from ↵Irit Katriel2021-11-302-32/+51
| | | | the exception instance (GH-29780)
* bpo-45786: Allocate space for frame in frame object. (GH-29729)Mark Shannon2021-11-292-30/+20
|
* Remove misleading comment in the AST optimizer (#29825)Serhiy Storchaka2021-11-291-1/+0
|
* bpo-45915: use fcntl(fd, F_GETFD) in is_valid_fd() (GH-29821)Christian Heimes2021-11-281-3/+15
|
* bpo-45614: Fix traceback display for exceptions with invalid module name ↵Irit Katriel2021-11-271-1/+1
| | | | (GH-29726)
* bpo-45711: use exc_value instead of exc_type to determine if exc_info is ↵Irit Katriel2021-11-254-36/+91
| | | | valid. Add more assertions. (GH-29627)
* bpo-45020: Fix strict-prototypes warning (GH-29755)Christian Heimes2021-11-241-1/+1
|
* bpo-44525: Copy free variables in bytecode to allow calls to inner functions ↵Mark Shannon2021-11-237-62/+93
| | | | | | | | | | | to be specialized (GH-29595) * Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead. * Add reference to function to frame, borrow references to builtins and globals. * Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
* bpo-45850: Implement deep-freeze on Windows (#29648)Guido van Rossum2021-11-221-5/+0
| | | | | | Implement changes to build with deep-frozen modules on Windows. Note that we now require Python 3.10 as the "bootstrap" or "host" Python. This causes a modest startup speed (around 7%) on Windows.
* bpo-45871: Refactor except matcher validation into a separate function so ↵Irit Katriel2021-11-221-23/+33
| | | | that it can be reused. Add missing unit test. (GH-29711)
* bpo-45813: Make sure that frame->generator is NULLed when generator is ↵Mark Shannon2021-11-221-0/+3
| | | | deallocated. (GH-29700)
* bpo-45848: Allow the parser to get error lines from encoded files (GH-29646)Pablo Galindo Salgado2021-11-201-4/+14
|
* Fix link to exception handling notes (GH-29617)Irit Katriel2021-11-191-1/+1
|
* bpo-45709: Fix tracing when exception is handled. (GH-29638)Mark Shannon2021-11-191-4/+1
|