main commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-16 16:30:25 +09:00
parent 91c7e04474
commit 537e7b363f
1146 changed files with 45926 additions and 77196 deletions

View File

@@ -1,5 +1,5 @@
# event/attr.py
# Copyright (C) 2005-2025 the SQLAlchemy authors and contributors
# Copyright (C) 2005-2023 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
@@ -391,23 +391,20 @@ class _EmptyListener(_InstanceLevelDispatch[_ET]):
class _MutexProtocol(Protocol):
def __enter__(self) -> bool: ...
def __enter__(self) -> bool:
...
def __exit__(
self,
exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType],
) -> Optional[bool]: ...
) -> Optional[bool]:
...
class _CompoundListener(_InstanceLevelDispatch[_ET]):
__slots__ = (
"_exec_once_mutex",
"_exec_once",
"_exec_w_sync_once",
"_is_asyncio",
)
__slots__ = "_exec_once_mutex", "_exec_once", "_exec_w_sync_once"
_exec_once_mutex: _MutexProtocol
parent_listeners: Collection[_ListenerFnType]
@@ -415,18 +412,11 @@ class _CompoundListener(_InstanceLevelDispatch[_ET]):
_exec_once: bool
_exec_w_sync_once: bool
def __init__(self, *arg: Any, **kw: Any):
super().__init__(*arg, **kw)
self._is_asyncio = False
def _set_asyncio(self) -> None:
self._is_asyncio = True
self._exec_once_mutex = AsyncAdaptedLock()
def _memoized_attr__exec_once_mutex(self) -> _MutexProtocol:
if self._is_asyncio:
return AsyncAdaptedLock()
else:
return threading.Lock()
return threading.Lock()
def _exec_once_impl(
self, retry_on_exception: bool, *args: Any, **kw: Any
@@ -535,7 +525,6 @@ class _ListenerCollection(_CompoundListener[_ET]):
propagate: Set[_ListenerFnType]
def __init__(self, parent: _ClsLevelDispatch[_ET], target_cls: Type[_ET]):
super().__init__()
if target_cls not in parent._clslevel:
parent.update_subclass(target_cls)
self._exec_once = False
@@ -575,9 +564,6 @@ class _ListenerCollection(_CompoundListener[_ET]):
existing_listeners.extend(other_listeners)
if other._is_asyncio:
self._set_asyncio()
to_associate = other.propagate.union(other_listeners)
registry._stored_in_collection_multi(self, other, to_associate)