| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Ignore linter "imported but unused" warnings in tests when the linter
doesn't understand how the import is used.
|
| |
|
| |
|
| |
|
|
|
|
| |
In the limited C API 3.14 and newer, Py_TYPE() is now implemented as
an opaque function call to hide implementation details.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This exposes `PyUnstable_Object_ClearWeakRefsNoCallbacks` as an unstable
C-API function to provide a thread-safe mechanism for clearing weakrefs
without executing callbacks.
Some C-API extensions need to clear weakrefs without calling callbacks,
such as after running finalizers like we do in subtype_dealloc.
Previously they could use `_PyWeakref_ClearRef` on each weakref, but
that's not thread-safe in the free-threaded build.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The `inspect.ismethoddescriptor()` function did not check for the lack of
`__delete__()` and, consequently, erroneously returned True when applied
to *data* descriptors with only `__get__()` and `__delete__()` defined.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
|
|
|
|
|
|
|
|
|
| |
(#120640)
* Remove BEFORE_WITH and BEFORE_ASYNC_WITH instructions.
* Add LOAD_SPECIAL instruction
* Reimplement `with` and `async with` statements using LOAD_SPECIAL
|
|
|
| |
gh-120467: Add test for lambda generator invocation
|
|
|
|
|
|
| |
Mocking only works if sys.modules['pydoc'] and pydoc are the same,
but some pydoc functions reload the module and change sys.modules.
Ensure that sys.modules['pydoc'] is always restored after the corresponding
tests.
|
| |
|
|
|
|
|
| |
_PyRuntime.types.managed_static.types[i].interp_count (gh-120529)
gh-120182 added new global state (interp_count), but didn't add thread-safety for it. This change eliminates the possible race.
|
|
|
| |
Run test_module_for_bdb with a specific namespace.
|
| |
|
| |
|
| |
|
|
|
|
| |
Fix a race in `PyMember_GetOne` and `PyMember_SetOne` for `Py_T_OBJECT_EX`.
These functions implement `__slots__` accesses for Python objects.
|
|
|
|
|
| |
(#120315)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
|
| |
|
|
|
|
|
| |
Reword error message for unawaitable types.
|
|
|
|
|
| |
expressions (#119976)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
| |
* Rename _POP_FRAME to _RETURN_VALUE as it returns a value as well as popping a frame.
* Remove remaining _POP_FRAMEs
|
|
|
|
| |
blocks (#120425)
|
|
|
|
| |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
|
|
|
|
|
| |
`socketserver.TCPServer` (GH-120488)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
|
| |
|
|
|
|
|
| |
(GH-120486)
This matches the output behavior in 3.10 and earlier; the optimization in 3.11 allowed the zlib library's "os" value to be filled in instead in the circumstance when mtime was 0. this keeps things consistent.
|
|
|
|
|
| |
When help() is called with non-string argument, use __qualname__ or
__name__ if available, otherwise use "{typename} object".
|
|
|
|
| |
`eval_str=True` (#120550)
|
|
|
| |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
(#120477)
Use the correct loader for iOS.
|
|
|
|
|
| |
subprocess support (#120476)
Skip tests that require multiprocessing subprocess support.
|
|
|
|
| |
test_interpreters.test_stress (gh-120525)
|
|
|
|
|
|
|
| |
In gh-120009 I used an atexit hook to finalize the _datetime module's static types at interpreter shutdown. However, atexit hooks are executed very early in finalization, which is a problem in the few cases where a subclass of one of those static types is still alive until the final GC collection. The static builtin types don't have this probably because they are finalized toward the end, after the final GC collection. To avoid the problem for _datetime, I have applied a similar approach here.
Also, credit goes to @mgorny and @neonene for the new tests.
FYI, I would have liked to take a slightly cleaner approach with managed static types, but wanted to get a smaller fix in first for the sake of backporting. I'll circle back to the cleaner approach with a future change on the main branch.
|
|
|
|
|
|
|
|
|
|
|
| |
Add __all__ to the following modules:
importlib.machinery, importlib.util and xml.sax.
Add also "# noqa: F401" in collections.abc,
subprocess and xml.sax.
* Sort __all__; remove collections.abc.__all__; remove private names
* Add tests
|
|
|
| |
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
|
|
|
|
| |
(GH-120364)
* gh-120361: Add `nonmember` test with enum flags inside to `test_enum`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a `Path.copy()` method that copies the content of one file to another.
This method is similar to `shutil.copyfile()` but differs in the following ways:
- Uses `fcntl.FICLONE` where available (see GH-81338)
- Uses `os.copy_file_range` where available (see GH-81340)
- Uses `_winapi.CopyFile2` where available, even though this copies more metadata than the other implementations. This makes `WindowsPath.copy()` more similar to `shutil.copy2()`.
The method is presently _less_ specified than the `shutil` functions to allow OS-specific optimizations that might copy more or less metadata.
Incorporates code from GH-81338 and GH-93152.
Co-authored-by: Eryk Sun <eryksun@gmail.com>
|
| |
|
| |
|
|
|
|
| |
`inspect.get_annotations` (#120270)
|
|
|
|
|
|
|
|
| |
queues. (GH-120102)
* improve doc for `multiprocessing.Queue.empty`
* add tests for checking emptiness of queues
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
| |
Check if the DateTime C-API type matches the datetime.date type on main and shared/isolated subinterpreters.
|
|
|
|
|
| |
Tools such as ruff can ignore "imported but unused" warnings if a
line ends with "# noqa: F401". It avoids the temptation to remove
an import which is used effectively.
|
|
|
|
|
|
|
|
| |
Remove wheeldata from both sides of the `assertEqual`, so that we're
*actually* ignoring it from the test set.
This test is only making assertions about the source tree, no code is
being executed that would do anything different based on the value of
`WHEEL_PKG_DIR`.
|
| |
|