mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
If importing with ``TYPE_CHECKING is True`` fails, reset the state of ``sys.modules`` so that the attempt with ``TYPE_CHECKING is False`` may succeed. Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
5 lines
82 B
Python
5 lines
82 B
Python
import typing
|
|
|
|
if typing.TYPE_CHECKING:
|
|
from circular_import import SomeClass
|