]> 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:47:02 +0000 (08:47 -0500)
this is to help with vscode extensions

Change-Id: I4dc6c07bec8158c82e376b3399d6e0e104360bf2
(cherry picked from commit 828bedbe3ab096d30ade65e387feaffe6c1207e5)

doc/build/conf.py

index 2990e85da3659ebdc460a89584fb437f0c521dcf..061b066ceed9df020ec617720d3e791803995d7e 100644 (file)
@@ -487,6 +487,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