summaryrefslogtreecommitdiff
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-39427: Document -X opt options in the CLI --help and the man page (GH-18131)Pablo Galindo2020-01-221-1/+32
| | | | | | | https://bugs.python.org/issue39427 Automerge-Triggered-By: @pablogsal
* bpo-39336: Allow packages to not let their child modules be set on them (#18006)Dino Viehland2020-01-221-337/+346
| | | | | * bpo-39336: Allow setattr to fail on modules which aren't assignable When attaching a child module to a package if the object in sys.modules raises an AttributeError (e.g. because it is immutable) it causes the whole import to fail. This now allows immutable packages to exist and an ImportWarning is reported and the AttributeError exception is ignored.
* bpo-31031: Unify duplicate bits_in_digit and bit_length (GH-2866)Niklas Fiekas2020-01-161-0/+15
| | | Add _Py_bit_length() to unify duplicate bits_in_digit() and bit_length().
* Fix compiler warning on Windows (GH-18012)Ammar Askar2020-01-151-1/+1
| | | | | | | | Python-ast.h contains a macro named Yield that conflicts with the Yield macro in Windows system headers. While Python-ast.h has an "undef Yield" directive to prevent this, it means that Python-ast.h must be included before Windows header files or we run into a re-declaration warning. In commit c96be811fa7d an include for pycore_pystate.h was added which indirectly includes Windows header files. In this commit we re-order the includes to fix this warning.
* bpo-39164: Fix compiler warning in PyErr_GetExcInfo() (GH-18010)Victor Stinner2020-01-151-1/+1
| | | The function has no return value.
* bpo-39048: Look up __aenter__ before __aexit__ in async with (GH-17609)Géry Ogam2020-01-141-9/+10
| | | | | | * Reorder the __aenter__ and __aexit__ checks for async with * Add assertions for async with body being skipped * Swap __aexit__ and __aenter__ loading in the documentation
* bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)Mark Shannon2020-01-147-4753/+4780
| | | | | | | | Break up COMPARE_OP into four logically distinct opcodes: * COMPARE_OP for rich comparisons * IS_OP for 'is' and 'is not' tests * CONTAINS_OP for 'in' and 'is not' tests * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
* bpo-38644: Pass tstate to _Py_FinishPendingCalls() (GH-17990)Victor Stinner2020-01-132-3/+3
| | | | _Py_FinishPendingCalls() now expects a tstate argument, instead of a runtime argument.
* bpo-39164: Add private _PyErr_GetExcInfo() function (GH-17752)Julien Danjou2020-01-131-4/+10
| | | | | | This adds a new function named _PyErr_GetExcInfo() that is a variation of the original PyErr_GetExcInfo() taking a PyThreadState as its first argument. That function allows to retrieve the exceptions information of any Python thread -- not only the current one.
* Cleanup exit code for interpreter. (GH-17756)Mark Shannon2020-01-131-6/+5
|
* bpo-39200: Correct the error message for min/max builtin function (GH-17814)Dong-hee Na2020-01-101-2/+7
| | | | Correct the error message when calling the min() or max() with no arguments.
* bpo-39166: Fix trace of last iteration of async for loops (#17800)Pablo Galindo2020-01-101-5/+9
|
* bpo-39235: Fix end location for genexp in call args (GH-17925)Guido van Rossum2020-01-091-8/+8
| | | | | | The fix changes copy_location() to require an extra node from which to extract the end location, and fixing all 5 call sites. https://bugs.python.org/issue39235
* bpo-39270: Remove dead assignment from config_init_module_search_paths ↵Alex Henrie2020-01-091-2/+1
| | | | (GH-17914)
* closes bpo-39261: Remove dead assignment from pyinit_config. (GH-17907)Alex Henrie2020-01-081-1/+0
|
* bpo-29778: Fix incorrect NULL check in _PyPathConfig_InitDLLPath() (GH-17818)Anthony Wee2020-01-061-1/+1
|
* Fix constant folding optimization for positional only arguments (GH-17837)Anthony Sottile2020-01-051-0/+1
|
* Fix SystemError when nested function has annotation on positional-only ↵Anthony Sottile2020-01-051-0/+2
| | | | argument (GH-17826)
* Bring Python into the next decade. (GH-17801)Benjamin Peterson2020-01-021-1/+1
|
* bpo-39114: Fix tracing of except handlers with name binding (GH-17769)Pablo Galindo2020-01-021-1/+3
| | | When producing the bytecode of exception handlers with name binding (like `except Exception as e`) we need to produce a try-finally block to make sure that the name is deleted after the handler is executed to prevent cycles in the stack frame objects. The bytecode associated with this try-finally block does not have source lines associated and it was causing problems when the tracing functionality was running over it.
* bpo-13601: always use line-buffering for sys.stderr (GH-17646)Jendrik Seipp2020-01-011-1/+1
|
* bpo-39176: Improve error message for 'named assignment' (GH-17777)Ned Batchelder2019-12-311-1/+1
|
* closes bpo-37446: resolve undefined behavior in Python/hamt.c (GH-17727)Batuhan Taşkaya2019-12-301-1/+1
|
* Fix handling of line numbers around finally-blocks. (#17737)Mark Shannon2019-12-302-1622/+1626
|
* bpo-39028: Performance enhancement in keyword extraction (GH-17576)Sebastian Berg2019-12-181-3/+7
| | | | | | | | All keywords should first be checked for pointer identity. Only after that failed for all keywords (unlikely) should unicode equality be used. The original code would call unicode equality on any non-matching keyword argument. Meaning calling it often e.g. when a function has many kwargs but only the last one is provided.
* bpo-39080: Starred Expression's column offset fix when inside a CALL (GH-17645)Lysandros Nikolaou2019-12-181-1/+1
| | | | Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
* bpo-38858: Small integer per interpreter (GH-17315)Victor Stinner2019-12-171-4/+9
| | | | | | | | | | | | Each Python subinterpreter now has its own "small integer singletons": numbers in [-5; 257] range. It is no longer possible to change the number of small integers at build time by overriding NSMALLNEGINTS and NSMALLPOSINTS macros: macros should now be modified manually in pycore_pystate.h header file. For now, continue to share _PyLong_Zero and _PyLong_One singletons between all subinterpreters.
* bpo-39033: Fix NameError in zipimport during hash validation (GH-17588)Xtreak2019-12-161-268/+267
| | | | Patch by Karthikeyan Singaravelan.
* The comment in ast_for_namedexpr shouldn't include if_stmt (GH-17586)Guido van Rossum2019-12-151-3/+1
| | | Automerge-Triggered-By: @gvanrossum
* Fix elif start column offset when there is an else following (GH-17596)Lysandros Nikolaou2019-12-141-2/+2
|
* Add PYTHONUTF8 to commandline usage. (GH-17587)Inada Naoki2019-12-141-0/+1
| | | | Co-Authored-By: Victor Stinner <vstinner@python.org>
* bpo-39031: Include elif keyword when producing lineno/col-offset info for ↵Lysandros Nikolaou2019-12-121-2/+2
| | | | | | | | | | | | if_stmt (GH-17582) When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node. https://bugs.python.org/issue39031 Automerge-Triggered-By: @pablogsal
* bpo-39008: Require Py_ssize_t for PySys_Audit formats rather than raise a ↵Steve Dower2019-12-091-1/+1
| | | | deprecation warning (GH-17540)
* bpo-20443: No longer make sys.argv[0] absolute for script (GH-17534)Victor Stinner2019-12-091-4/+0
| | | | | In Python 3.9.0a1, sys.argv[0] was made an asolute path if a filename was specified on the command line. Revert this change, since most users expect sys.argv to be unmodified.
* bpo-38858: Fix ref leak in pycore_interp_init() (GH-17512)Victor Stinner2019-12-081-5/+10
| | | | | bpo-38858, bpo-38997: _PySys_Create() returns a strong reference to the sys module: Py_DECREF() is needed when we are done with the module.
* bpo-38979: fix ContextVar "__class_getitem__" method (GH-17497)AMIR2019-12-081-3/+4
| | | | | | | | | | now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None. https://bugs.python.org/issue38979 Automerge-Triggered-By: @asvetlov
* bpo-38852: Set thread stack size to 8 Mb for debug builds on android ↵xdegaye2019-12-081-0/+10
| | | | platforms (GH-17337)
* bpo-38858: Add pycore_interp_init() code to factorize code (GH-17483)Victor Stinner2019-12-061-32/+24
| | | | Add a new pycore_interp_init() function called by new_interpreter() and pyinit_config().
* bpo-38858: new_interpreter() reuses _PySys_Create() (GH-17481)Victor Stinner2019-12-062-54/+46
| | | | | | | new_interpreter() now calls _PySys_Create() to create a new sys module isolated from the main interpreter. It now calls _PySys_InitCore() and _PyImport_FixupBuiltin(). init_interp_main() now calls _PySys_InitMain().
* Remove unused variable in Python/pylifecycle.c (GH-17475)Pablo Galindo2019-12-051-2/+0
|
* bpo-38962: Fix reference leak in the per-subinterpreter gc (GH-17457)Pablo Galindo2019-12-041-6/+5
| | | | | | | https://bugs.python.org/issue38962 Automerge-Triggered-By: @pablogsal
* bpo-38962: Fix reference leak in new_interpreter() (GH-17453)Pablo Galindo2019-12-041-0/+2
| | | | | | | https://bugs.python.org/issue38962 Automerge-Triggered-By: @pablogsal
* bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisable hooks ↵Steve Dower2019-11-283-32/+50
| | | | | are invoked (GH-17392) Also fixes some potential segfaults in unraisable hook handling.
* bpo-38328: Speed up the creation time of constant list and set display. ↵Brandt Bucher2019-11-261-0/+22
| | | | (GH-17114)
* bpo-38858: new_interpreter() uses pycore_init_import_warnings() (GH-17353)Victor Stinner2019-11-221-14/+11
|
* bpo-38858: new_interpreter() reuses pycore_init_builtins() (GH-17351)Victor Stinner2019-11-222-40/+24
| | | | | | | | | new_interpreter() now calls _PyBuiltin_Init() to create the builtins module and calls _PyImport_FixupBuiltin(), rather than using _PyImport_FindBuiltin(tstate, "builtins"). pycore_init_builtins() is now responsible to initialize intepr->builtins_copy: inline _PyImport_Init() and remove this function.
* bpo-38858: _PyImport_FixupExtensionObject() handles subinterpreters (GH-17350)Victor Stinner2019-11-222-45/+64
| | | | | If _PyImport_FixupExtensionObject() is called from a subinterpreter, leave extensions unchanged and don't copy the module dictionary into def->m_base.m_copy.
* bpo-38858: Add init_interp_main() subfunction (GH-17347)Victor Stinner2019-11-221-103/+109
| | | | Fix new_interpreter() error handling: undo it all if status is an exception.
* bpo-38858: Add init_set_builtins_open() subfunction (GH-17346)Victor Stinner2019-11-221-18/+50
|
* bpo-38858: Call _PyUnicode_Fini() in Py_EndInterpreter() (GH-17330)Victor Stinner2019-11-221-5/+5
| | | Py_EndInterpreter() now clears the filesystem codec.