]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
dont fail if imports not set up
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 10 Nov 2025 13:43:10 +0000 (08:43 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 10 Nov 2025 13:43:10 +0000 (08:43 -0500)
this is to help with vscode extensions

Change-Id: I4dc6c07bec8158c82e376b3399d6e0e104360bf2

doc/build/conf.py

index 070eba23f42e40cdb1f3e5ad8fe8e4911bcc529b..2748faa93ebcd59d505ba41263d93de31eb16e2d 100644 (file)
@@ -485,6 +485,9 @@ def setup(app):  # noqa: U100
     # delete class attributes with a value, where the value has ``__doc__``
     # defined, but we want to see only the docstring under the attribute
     # itself.
-    from sqlalchemy.ext.asyncio import AsyncSession
-
-    del AsyncSession.sync_session_class
+    try:
+        from sqlalchemy.ext.asyncio import AsyncSession
+    except ImportError:
+        pass
+    else:
+        del AsyncSession.sync_session_class