wrapt 2.3.0rc2__tar.gz → 2.4.0.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wrapt-2.3.0rc2/src/wrapt.egg-info → wrapt-2.4.0.dev2}/PKG-INFO +2 -1
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/pyproject.toml +1 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/__init__.py +1 -1
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/_wrappers.c +95 -18
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2/src/wrapt.egg-info}/PKG-INFO +2 -1
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/LICENSE +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/MANIFEST.in +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/README.md +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/RELEASE.rst +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/setup.cfg +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/setup.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/__wrapt__.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/arguments.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/caching.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/decorators.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/importer.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/patches.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/proxies.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/signature.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/synchronization.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/weakrefs.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt/wrappers.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt-stubs/__init__.pyi +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt.egg-info/SOURCES.txt +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt.egg-info/dependency_links.txt +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt.egg-info/not-zip-safe +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt.egg-info/requires.txt +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/src/wrapt.egg-info/top_level.txt +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/conftest.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/compat.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/module1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/module2.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_adapter.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_adapter_annotations.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_adapter_kwonly.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_annotations.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_attribute_wrapper.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_auto_object_proxy.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_callable_binding_no_args.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_callable_object_proxy.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_class.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_class_mro_entries.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_copy.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_decorator_state.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_decorators.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_deferred_patching.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_descriptor_get_class_access.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_descriptors.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_enabled_bool_error.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_entry_points.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_formatargspec.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_function.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_function_wrapper.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_inheritance.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_inner_classmethod.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_inner_staticmethod.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_inplace_operators.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_instancemethod.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_lazy_object_proxy.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_lru_cache.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_memoize.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_monkey_patching.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_nested_function.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_object_proxy.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_object_proxy_hook.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_object_proxy_self_dict.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_object_proxy_type_checks.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_outer_classmethod.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_outer_staticmethod.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_pickle.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_post_import_hooks.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_pyerr_clear_propagation.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_resolve_path.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_runtime_type_hints.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_synchronized_async.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_synchronized_lock.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_synchronized_markers.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_type_module_attribute.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_update_attributes.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_weak_function_proxy.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/core/test_with_signature.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_auto_object_proxy_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_auto_object_proxy_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_decorator_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_decorator_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t2.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t2.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t3.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t3.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t4.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t4.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t5.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t5.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t6.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t6.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t7.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t7.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t8.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_cls_t8.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t2.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t2.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t3.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t3.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t4.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t4.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t5.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t5.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t6.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t6.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t7.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_function_wrapper_fn_t7.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_object_proxy_arithmetic_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_object_proxy_arithmetic_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_object_proxy_container_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_object_proxy_container_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_object_proxy_context_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_object_proxy_context_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_partial_callable_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_partial_callable_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_patch_function_wrapper_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_patch_function_wrapper_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_patching_primitives_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_patching_primitives_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_post_import_hooks_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_post_import_hooks_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_synchronized_lock_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_synchronized_lock_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_transient_function_wrapper_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_transient_function_wrapper_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_weak_function_proxy_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_weak_function_proxy_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t1.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t1.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t2.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t2.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t3.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t3.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t4.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t4.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t5.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t5.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t6.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t6.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t7.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t7.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t8.out +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tests/mypy/mypy_wrap_function_wrapper_t8.py +0 -0
- {wrapt-2.3.0rc2 → wrapt-2.4.0.dev2}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wrapt
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0.dev2
|
|
4
4
|
Summary: Module for decorators, wrappers and monkey patching.
|
|
5
5
|
Author-email: Graham Dumpleton <Graham.Dumpleton@gmail.com>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
20
21
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
21
22
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
22
23
|
Requires-Python: >=3.9
|
|
@@ -23,6 +23,7 @@ classifiers = [
|
|
|
23
23
|
"Programming Language :: Python :: 3.12",
|
|
24
24
|
"Programming Language :: Python :: 3.13",
|
|
25
25
|
"Programming Language :: Python :: 3.14",
|
|
26
|
+
"Programming Language :: Python :: 3.15",
|
|
26
27
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
27
28
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
28
29
|
]
|
|
@@ -153,6 +153,15 @@ static PyObject *PyType_GetModuleByDef(PyTypeObject *type,
|
|
|
153
153
|
}
|
|
154
154
|
#endif
|
|
155
155
|
|
|
156
|
+
/* Polyfill the critical section API for Python < 3.13. Free-threaded
|
|
157
|
+
* builds only exist on 3.13+, where the real macros are provided (and are
|
|
158
|
+
* no-ops on GIL builds), so expanding to plain blocks here is safe. */
|
|
159
|
+
|
|
160
|
+
#if PY_VERSION_HEX < 0x030D0000
|
|
161
|
+
#define Py_BEGIN_CRITICAL_SECTION(op) {
|
|
162
|
+
#define Py_END_CRITICAL_SECTION() }
|
|
163
|
+
#endif
|
|
164
|
+
|
|
156
165
|
/* Polyfill PyObject_GetOptionalAttrString for Python < 3.13. Matches the
|
|
157
166
|
* 3.13+ semantics: returns 1 if found, 0 if not found (AttributeError
|
|
158
167
|
* only), -1 on other errors with exception set. */
|
|
@@ -446,8 +455,16 @@ static int WraptObjectProxy_raw_init(WraptObjectProxyObject *self,
|
|
|
446
455
|
}
|
|
447
456
|
}
|
|
448
457
|
|
|
458
|
+
/* Serialise the swap for the same reason as in the __wrapped__ setter.
|
|
459
|
+
* Normally __init__ runs before the proxy is shared, but it can be
|
|
460
|
+
* re-invoked on an already published proxy, in which case concurrent
|
|
461
|
+
* callers on a free-threaded build could otherwise decref the same old
|
|
462
|
+
* wrapped object twice. */
|
|
463
|
+
|
|
449
464
|
Py_INCREF(wrapped);
|
|
465
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
450
466
|
Py_XSETREF(self->wrapped, wrapped);
|
|
467
|
+
Py_END_CRITICAL_SECTION();
|
|
451
468
|
|
|
452
469
|
self->init_called = 1;
|
|
453
470
|
|
|
@@ -1061,7 +1078,16 @@ static PyObject *WraptObjectProxy_inplace_add(WraptObjectProxyObject *self,
|
|
|
1061
1078
|
if (!object)
|
|
1062
1079
|
return NULL;
|
|
1063
1080
|
|
|
1081
|
+
/* As in the __wrapped__ setter, serialise the swap so that concurrent
|
|
1082
|
+
* in-place operations on the same proxy cannot decref the same old
|
|
1083
|
+
* wrapped object twice on a free-threaded build. The wrapped object
|
|
1084
|
+
* was read before the operation ran, so a concurrent mutation can
|
|
1085
|
+
* still be lost, matching pure Python semantics. The same applies to
|
|
1086
|
+
* all of the in-place operators which follow. */
|
|
1087
|
+
|
|
1088
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1064
1089
|
Py_SETREF(self->wrapped, object);
|
|
1090
|
+
Py_END_CRITICAL_SECTION();
|
|
1065
1091
|
|
|
1066
1092
|
Py_INCREF(self);
|
|
1067
1093
|
return (PyObject *)self;
|
|
@@ -1143,7 +1169,9 @@ static PyObject *WraptObjectProxy_inplace_subtract(WraptObjectProxyObject *self,
|
|
|
1143
1169
|
if (!object)
|
|
1144
1170
|
return NULL;
|
|
1145
1171
|
|
|
1172
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1146
1173
|
Py_SETREF(self->wrapped, object);
|
|
1174
|
+
Py_END_CRITICAL_SECTION();
|
|
1147
1175
|
|
|
1148
1176
|
Py_INCREF(self);
|
|
1149
1177
|
return (PyObject *)self;
|
|
@@ -1225,7 +1253,9 @@ static PyObject *WraptObjectProxy_inplace_multiply(WraptObjectProxyObject *self,
|
|
|
1225
1253
|
if (!object)
|
|
1226
1254
|
return NULL;
|
|
1227
1255
|
|
|
1256
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1228
1257
|
Py_SETREF(self->wrapped, object);
|
|
1258
|
+
Py_END_CRITICAL_SECTION();
|
|
1229
1259
|
|
|
1230
1260
|
Py_INCREF(self);
|
|
1231
1261
|
return (PyObject *)self;
|
|
@@ -1308,7 +1338,9 @@ WraptObjectProxy_inplace_remainder(WraptObjectProxyObject *self,
|
|
|
1308
1338
|
if (!object)
|
|
1309
1339
|
return NULL;
|
|
1310
1340
|
|
|
1341
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1311
1342
|
Py_SETREF(self->wrapped, object);
|
|
1343
|
+
Py_END_CRITICAL_SECTION();
|
|
1312
1344
|
|
|
1313
1345
|
Py_INCREF(self);
|
|
1314
1346
|
return (PyObject *)self;
|
|
@@ -1391,7 +1423,9 @@ static PyObject *WraptObjectProxy_inplace_power(WraptObjectProxyObject *self,
|
|
|
1391
1423
|
if (!object)
|
|
1392
1424
|
return NULL;
|
|
1393
1425
|
|
|
1426
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1394
1427
|
Py_SETREF(self->wrapped, object);
|
|
1428
|
+
Py_END_CRITICAL_SECTION();
|
|
1395
1429
|
|
|
1396
1430
|
Py_INCREF(self);
|
|
1397
1431
|
return (PyObject *)self;
|
|
@@ -1473,7 +1507,9 @@ static PyObject *WraptObjectProxy_inplace_lshift(WraptObjectProxyObject *self,
|
|
|
1473
1507
|
if (!object)
|
|
1474
1508
|
return NULL;
|
|
1475
1509
|
|
|
1510
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1476
1511
|
Py_SETREF(self->wrapped, object);
|
|
1512
|
+
Py_END_CRITICAL_SECTION();
|
|
1477
1513
|
|
|
1478
1514
|
Py_INCREF(self);
|
|
1479
1515
|
return (PyObject *)self;
|
|
@@ -1555,7 +1591,9 @@ static PyObject *WraptObjectProxy_inplace_rshift(WraptObjectProxyObject *self,
|
|
|
1555
1591
|
if (!object)
|
|
1556
1592
|
return NULL;
|
|
1557
1593
|
|
|
1594
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1558
1595
|
Py_SETREF(self->wrapped, object);
|
|
1596
|
+
Py_END_CRITICAL_SECTION();
|
|
1559
1597
|
|
|
1560
1598
|
Py_INCREF(self);
|
|
1561
1599
|
return (PyObject *)self;
|
|
@@ -1637,7 +1675,9 @@ static PyObject *WraptObjectProxy_inplace_and(WraptObjectProxyObject *self,
|
|
|
1637
1675
|
if (!object)
|
|
1638
1676
|
return NULL;
|
|
1639
1677
|
|
|
1678
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1640
1679
|
Py_SETREF(self->wrapped, object);
|
|
1680
|
+
Py_END_CRITICAL_SECTION();
|
|
1641
1681
|
|
|
1642
1682
|
Py_INCREF(self);
|
|
1643
1683
|
return (PyObject *)self;
|
|
@@ -1719,7 +1759,9 @@ static PyObject *WraptObjectProxy_inplace_xor(WraptObjectProxyObject *self,
|
|
|
1719
1759
|
if (!object)
|
|
1720
1760
|
return NULL;
|
|
1721
1761
|
|
|
1762
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1722
1763
|
Py_SETREF(self->wrapped, object);
|
|
1764
|
+
Py_END_CRITICAL_SECTION();
|
|
1723
1765
|
|
|
1724
1766
|
Py_INCREF(self);
|
|
1725
1767
|
return (PyObject *)self;
|
|
@@ -1801,7 +1843,9 @@ static PyObject *WraptObjectProxy_inplace_or(WraptObjectProxyObject *self,
|
|
|
1801
1843
|
if (!object)
|
|
1802
1844
|
return NULL;
|
|
1803
1845
|
|
|
1846
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1804
1847
|
Py_SETREF(self->wrapped, object);
|
|
1848
|
+
Py_END_CRITICAL_SECTION();
|
|
1805
1849
|
|
|
1806
1850
|
Py_INCREF(self);
|
|
1807
1851
|
return (PyObject *)self;
|
|
@@ -1942,7 +1986,9 @@ WraptObjectProxy_inplace_floor_divide(WraptObjectProxyObject *self,
|
|
|
1942
1986
|
if (!object)
|
|
1943
1987
|
return NULL;
|
|
1944
1988
|
|
|
1989
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
1945
1990
|
Py_SETREF(self->wrapped, object);
|
|
1991
|
+
Py_END_CRITICAL_SECTION();
|
|
1946
1992
|
|
|
1947
1993
|
Py_INCREF(self);
|
|
1948
1994
|
return (PyObject *)self;
|
|
@@ -2025,7 +2071,9 @@ WraptObjectProxy_inplace_true_divide(WraptObjectProxyObject *self,
|
|
|
2025
2071
|
if (!object)
|
|
2026
2072
|
return NULL;
|
|
2027
2073
|
|
|
2074
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
2028
2075
|
Py_SETREF(self->wrapped, object);
|
|
2076
|
+
Py_END_CRITICAL_SECTION();
|
|
2029
2077
|
|
|
2030
2078
|
Py_INCREF(self);
|
|
2031
2079
|
return (PyObject *)self;
|
|
@@ -2149,7 +2197,9 @@ static PyObject *WraptObjectProxy_inplace_matrix_multiply(
|
|
|
2149
2197
|
if (!object)
|
|
2150
2198
|
return NULL;
|
|
2151
2199
|
|
|
2200
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
2152
2201
|
Py_SETREF(self->wrapped, object);
|
|
2202
|
+
Py_END_CRITICAL_SECTION();
|
|
2153
2203
|
|
|
2154
2204
|
Py_INCREF(self);
|
|
2155
2205
|
return (PyObject *)self;
|
|
@@ -2920,15 +2970,22 @@ static int WraptObjectProxy_set_dict(WraptObjectProxyObject *self,
|
|
|
2920
2970
|
|
|
2921
2971
|
static PyObject *WraptObjectProxy_get_self_dict(WraptObjectProxyObject *self)
|
|
2922
2972
|
{
|
|
2973
|
+
PyObject *result = NULL;
|
|
2974
|
+
|
|
2975
|
+
/* self->dict is only NULL after tp_clear has run. Perform the lazy
|
|
2976
|
+
* recreation and the reference acquisition inside a critical section
|
|
2977
|
+
* so that two threads racing here on a free-threaded build cannot both
|
|
2978
|
+
* create a dict, leaking one of them, or return a dict which the other
|
|
2979
|
+
* thread has already replaced. */
|
|
2980
|
+
|
|
2981
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
2923
2982
|
if (!self->dict)
|
|
2924
|
-
{
|
|
2925
2983
|
self->dict = PyDict_New();
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2984
|
+
result = self->dict;
|
|
2985
|
+
Py_XINCREF(result);
|
|
2986
|
+
Py_END_CRITICAL_SECTION();
|
|
2929
2987
|
|
|
2930
|
-
|
|
2931
|
-
return self->dict;
|
|
2988
|
+
return result;
|
|
2932
2989
|
}
|
|
2933
2990
|
|
|
2934
2991
|
/* ------------------------------------------------------------------------- */
|
|
@@ -2973,8 +3030,16 @@ static int WraptObjectProxy_set_wrapped(WraptObjectProxyObject *self,
|
|
|
2973
3030
|
return -1;
|
|
2974
3031
|
}
|
|
2975
3032
|
|
|
3033
|
+
/* On free-threaded builds the swap must be serialised, otherwise two
|
|
3034
|
+
* threads assigning __wrapped__ on the same proxy can both read the same
|
|
3035
|
+
* old value and both decref it, releasing it twice. The critical section
|
|
3036
|
+
* covers only the swap; __wrapped_setattr_fixups__ below runs arbitrary
|
|
3037
|
+
* Python code and must stay outside it. */
|
|
3038
|
+
|
|
2976
3039
|
Py_INCREF(value);
|
|
3040
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
2977
3041
|
Py_XSETREF(self->wrapped, value);
|
|
3042
|
+
Py_END_CRITICAL_SECTION();
|
|
2978
3043
|
|
|
2979
3044
|
fixups = PyObject_GetAttr((PyObject *)self, state->str_setattr_fixups);
|
|
2980
3045
|
|
|
@@ -3386,11 +3451,19 @@ static int WraptPartialCallableObjectProxy_raw_init(
|
|
|
3386
3451
|
|
|
3387
3452
|
if (result == 0)
|
|
3388
3453
|
{
|
|
3389
|
-
|
|
3390
|
-
|
|
3454
|
+
/* Serialise the swaps for the same reason as in the __wrapped__
|
|
3455
|
+
* setter. Initialisation normally happens before the proxy is shared,
|
|
3456
|
+
* but __init__ can be re-invoked on an already published proxy, in
|
|
3457
|
+
* which case concurrent callers on a free-threaded build could
|
|
3458
|
+
* otherwise decref the same old args or kwargs twice. */
|
|
3391
3459
|
|
|
3460
|
+
Py_INCREF(args);
|
|
3392
3461
|
Py_XINCREF(kwargs);
|
|
3462
|
+
|
|
3463
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
3464
|
+
Py_XSETREF(self->args, args);
|
|
3393
3465
|
Py_XSETREF(self->kwargs, kwargs);
|
|
3466
|
+
Py_END_CRITICAL_SECTION();
|
|
3394
3467
|
}
|
|
3395
3468
|
|
|
3396
3469
|
return result;
|
|
@@ -3618,23 +3691,27 @@ static int WraptFunctionWrapperBase_raw_init(
|
|
|
3618
3691
|
|
|
3619
3692
|
if (result == 0)
|
|
3620
3693
|
{
|
|
3621
|
-
|
|
3622
|
-
|
|
3694
|
+
/* Serialise the swaps for the same reason as in the __wrapped__
|
|
3695
|
+
* setter. These fields have no setters, so re-invocation of __init__
|
|
3696
|
+
* on an already published wrapper is the only path by which
|
|
3697
|
+
* concurrent callers on a free-threaded build could otherwise decref
|
|
3698
|
+
* the same old field values twice. */
|
|
3623
3699
|
|
|
3700
|
+
Py_INCREF(instance);
|
|
3624
3701
|
Py_INCREF(wrapper);
|
|
3625
|
-
Py_XSETREF(self->wrapper, wrapper);
|
|
3626
|
-
|
|
3627
3702
|
Py_INCREF(enabled);
|
|
3628
|
-
Py_XSETREF(self->enabled, enabled);
|
|
3629
|
-
|
|
3630
3703
|
Py_INCREF(binding);
|
|
3631
|
-
Py_XSETREF(self->binding, binding);
|
|
3632
|
-
|
|
3633
3704
|
Py_INCREF(parent);
|
|
3634
|
-
Py_XSETREF(self->parent, parent);
|
|
3635
|
-
|
|
3636
3705
|
Py_INCREF(owner);
|
|
3706
|
+
|
|
3707
|
+
Py_BEGIN_CRITICAL_SECTION(self);
|
|
3708
|
+
Py_XSETREF(self->instance, instance);
|
|
3709
|
+
Py_XSETREF(self->wrapper, wrapper);
|
|
3710
|
+
Py_XSETREF(self->enabled, enabled);
|
|
3711
|
+
Py_XSETREF(self->binding, binding);
|
|
3712
|
+
Py_XSETREF(self->parent, parent);
|
|
3637
3713
|
Py_XSETREF(self->owner, owner);
|
|
3714
|
+
Py_END_CRITICAL_SECTION();
|
|
3638
3715
|
}
|
|
3639
3716
|
|
|
3640
3717
|
return result;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wrapt
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0.dev2
|
|
4
4
|
Summary: Module for decorators, wrappers and monkey patching.
|
|
5
5
|
Author-email: Graham Dumpleton <Graham.Dumpleton@gmail.com>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
20
21
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
21
22
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
22
23
|
Requires-Python: >=3.9
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|