]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix: move close_all() positiom
authorBryan不可思议 <programripper@foxmail.com>
Sat, 14 Oct 2023 09:26:53 +0000 (09:26 +0000)
committerGitHub <noreply@github.com>
Sat, 14 Oct 2023 09:27:22 +0000 (09:27 +0000)
lib/sqlalchemy/ext/asyncio/scoping.py

index 3fddfc1b2d7307f6511e859d3396671879334e10..c1de97238f5054ee5c291cdd24c5a82532c4f5a6 100644 (file)
@@ -217,6 +217,21 @@ class async_scoped_session(Generic[_AS]):
             await self.registry().close()
         self.registry.clear()
 
+    @classmethod
+    async def close_all(cls) -> None:
+        r"""Close all :class:`_asyncio.AsyncSession` sessions.
+
+        .. container:: class_bases
+
+            Proxied for the :class:`_asyncio.AsyncSession` class on
+            behalf of the :class:`_asyncio.scoping.async_scoped_session` class.
+
+        .. deprecated:: 2.0 The :meth:`.AsyncSession.close_all` method is deprecated and will be removed in a future release.  Please refer to :func:`.session.close_all_sessions`.
+
+        """  # noqa: E501
+
+        return await AsyncSession.close_all()
+
     # START PROXY METHODS async_scoped_session
 
     # code within this block is **programmatically,
@@ -1543,21 +1558,6 @@ class async_scoped_session(Generic[_AS]):
 
         return self._proxied.info
 
-    @classmethod
-    async def close_all(cls) -> None:
-        r"""Close all :class:`_asyncio.AsyncSession` sessions.
-
-        .. container:: class_bases
-
-            Proxied for the :class:`_asyncio.AsyncSession` class on
-            behalf of the :class:`_asyncio.scoping.async_scoped_session` class.
-
-        .. deprecated:: 2.0 The :meth:`.AsyncSession.close_all` method is deprecated and will be removed in a future release.  Please refer to :func:`.session.close_all_sessions`.
-
-        """  # noqa: E501
-
-        return await AsyncSession.close_all()
-
     @classmethod
     def object_session(cls, instance: object) -> Optional[Session]:
         r"""Return the :class:`.Session` to which an object belongs.