From: Mike Bayer Date: Mon, 10 Nov 2025 13:43:10 +0000 (-0500) Subject: dont fail if imports not set up X-Git-Tag: rel_2_0_45~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b8f95f644f21b9f5c3fd81974a4051d7aad23e8;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git dont fail if imports not set up this is to help with vscode extensions Change-Id: I4dc6c07bec8158c82e376b3399d6e0e104360bf2 (cherry picked from commit 828bedbe3ab096d30ade65e387feaffe6c1207e5) --- diff --git a/doc/build/conf.py b/doc/build/conf.py index 2990e85da3..061b066cee 100644 --- a/doc/build/conf.py +++ b/doc/build/conf.py @@ -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