| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
It was positional-only de facto: documentation and two implementations
used three different name.
|
|
|
|
|
|
|
| |
Before this commit, if an exception was active inside a generator
when calling gen.throw(), that exception was lost (i.e. there was
no implicit exception chaining). This commit fixes that by
setting exc.__context__ when calling gen.throw(exc).
|
|
|
|
|
| |
I can add another commit with the new test case I wrote to verify that the warning was being printed before my change, stopped printing after my change, and that the function does not return null after my change.
Automerge-Triggered-By: @brettcannon
|
| |
|
|
|
|
|
|
|
|
|
| |
Otherwise we leave a dangling pointer to free'd memory. If we
then initialize a new interpreter in the same process and call
PyImport_ExtendInittab, we will (likely) crash when calling
PyMem_RawRealloc(inittab_copy, ...) since the pointer address
is bogus.
Automerge-Triggered-By: @brettcannon
|
| |
|
|
|
|
|
|
|
|
|
| |
An isolated subinterpreter cannot spawn threads, spawn a child
process or call os.fork().
* Add private _Py_NewInterpreter(isolated_subinterpreter) function.
* Add isolated=True keyword-only parameter to
_xxsubinterpreters.create().
* Allow again os.fork() in "non-isolated" subinterpreters.
|
|
|
|
|
| |
(GH-19811)" (#19821)
This reverts commit 2514a632fb7d37be24c2059d0e286d35600f9795.
|
|
|
|
|
| |
Before this commit, if an exception was active inside a generator
when calling gen.throw(), then that exception was lost (i.e. there
was no implicit exception chaining). This commit fixes that.
|
|
|
|
|
| |
* bpo-40394 - difflib.SequenceMatched.find_longest_match default args
Added default args to find_longest_match, as well as related tests.
|
| |
|
|
|
|
| |
Add support for CAN_J1939 sockets that wrap SAE J1939 protocol
functionality provided by Linux 5.4+ kernels.
|
| |
|
| |
|
|
|
|
|
| |
Remove _random.Random.randbytes(): the C implementation of
randbytes(). Implement the method in Python to ease subclassing:
randbytes() now directly reuses getrandbits().
|
|
|
| |
More robust frame.setlineno. Makes no assumptions about source->bytecode translation.
|
|
|
| |
test_gdb and test.pythoninfo now check gdb command exit code.
|
|
|
|
| |
Fix a race condition in concurrent.futures._ThreadWakeup: access to
_ThreadWakeup is now protected with the shutdown lock.
|
|
|
|
|
|
| |
New PyFrame_GetBack() function: get the frame next outer frame.
Replace frame->f_back with PyFrame_GetBack(frame) in most code but
frameobject.c, ceval.c and genobject.c.
|
|
|
|
| |
The PyThreadState_GetFrame() function now returns a strong reference
to the frame.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the following function from the C API:
* PyAsyncGen_ClearFreeLists()
* PyContext_ClearFreeList()
* PyDict_ClearFreeList()
* PyFloat_ClearFreeList()
* PyFrame_ClearFreeList()
* PyList_ClearFreeList()
* PySet_ClearFreeList()
* PyTuple_ClearFreeList()
Make these functions private, move them to the internal C API and
change their return type to void.
Call explicitly PyGC_Collect() to free all free lists.
Note: PySet_ClearFreeList() did nothing.
|
|
|
|
|
| |
This PR adds the functionality requested by https://github.com/ericsnowcurrently/multi-core-python/issues/52.
Automerge-Triggered-By: @ericsnowcurrently
|
|
|
|
|
|
| |
*** File "/usr/lib64/python3.9/turtledemo/__main__.py", line 275
bg="#d00" if clear == NORMAL else"#fca")
^
SyntaxError: invalid string prefix
|
|
|
|
|
|
|
| |
methods in MagicMock" (GH-19734)
* Revert "bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock (#16029)"
This reverts commit 72b1004657e60c900e4cd031b2635b587f4b280e.
|
|
|
| |
require `_generate_next_value_` to be defined before members
|
|
|
|
|
|
|
|
|
| |
PyFrame_GetCode(frame): return a borrowed reference to the frame
code.
Replace frame->f_code with PyFrame_GetCode(frame) in most code,
except in frameobject.c, genobject.c and ceval.c.
Also add PyFrame_GetLineNumber() to the limited C API.
|
|\ |
|
| | |
|
| |
| |
| |
| | |
Process.shutdown(wait=True) of concurrent.futures now closes
explicitly the result queue.
|
| |
| |
| |
| |
| |
| | |
Add a new close() method to multiprocessing.SimpleQueue to explicitly
close the queue.
Automerge-Triggered-By: @pitrou
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
Adds a short description of `PyDoc_STRVAR` and `PyDoc_STR` to "Useful macros" section of C-API docs.
Currently, there is [one lone mention](https://docs.python.org/3/c-api/module.html?highlight=pydoc_strvar#c.PyModuleDef) in the C-API reference, despite the fact that `PyDoc_STRVAR` is ubiquitous to `Modules/`.
Additionally, this properly uses `c:macro` within `Doc/c-api/module.rst` to link.
|
| |
|
|
|
|
|
| |
Import logging lazily in assertLogs() in unittest.
Move TestHandler from test.support to logging_helper.
|
|
|
|
|
| |
* Import asyncio lazily in unittest (only when IsolatedAsyncioTestCase is used).
* Import asyncio.events lazily in test.support.
|
|
|
|
|
| |
This is one of the few files that has intimate knowledge of the pyc file
format. Since it lacks tests it tends to become outdated fairly quickly.
At present it has been broken since the introduction of PEP 552.
|
|
|
|
|
| |
Deprecate lib2to3 module in light of PEP 617.
We anticipate removal in the 3.12 timeframe.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Optimize the subprocess module on FreeBSD using closefrom().
A single close(fd) syscall is cheap, but when sysconf(_SC_OPEN_MAX)
is high, the loop calling close(fd) on each file descriptor can take
several milliseconds.
The workaround on FreeBSD to improve performance was to load and
mount the fdescfs kernel module, but this is not enabled by default.
Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans
(kevans) and Kubilay Kocak (koobs):
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274
|
|
|
|
|
|
|
|
|
| |
On FreeBSD, os.closerange(fd_low, fd_high) now calls
closefrom(fd_low) if fd_high is greater than or equal to
sysconf(_SC_OPEN_MAX).
Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans
(kevans) and Kubilay Kocak (koobs):
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274
|
|
|
|
|
|
|
| |
Using `def` rather than `define` results in:
Ambiguous command "def pu": define, define-prefix.
Automerge-Triggered-By: @csabella
|
|
|
|
| |
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
|
|
|
|
| |
Added str.removeprefix and str.removesuffix methods and corresponding
bytes, bytearray, and collections.UserString methods to remove affixes
from a string if present. See PEP 616 for a full description.
|
|
|
|
|
|
|
|
| |
Fix the Windows implementation of os.waitpid() for exit code
larger than "INT_MAX >> 8". The exit status is now interpreted as an
unsigned number.
os.waitstatus_to_exitcode() now accepts wait status larger than
INT_MAX.
|
|
|
|
|
|
|
| |
Previously, python.org macOS installers did not alter the Current version
symlink in /Library/Frameworks/Python.framework/Versions when installing
a version of Python 3.x, only when installing 2.x. Now that Python 2 is
retired, it's time to change that. This should make it a bit easier
to embed Python 3 into other macOS applications.
|
|
|
|
|
|
|
| |
It is possible to use either '-isysroot /some/path' (with a space) or
'-isysroot/some/path' (no space in between). Support both forms in
places where special handling of -isysroot is done, rather than just
the first form.
Co-authored-by: Ned Deily <nad@python.org>
|
|
|
|
| |
Icon author: Andrew Clover, bpo-1490384
|
| |
|