Debian Codegraph @

tests/_compat.py

raw
1 # pylint: disable=no-name-in-module
2 """Compatibility shims for Python and Towncrier matrix."""
3
4
5 try:
6 # Towncrier >= 22.8.0rc1
7 # pylint: disable-next=unused-import
8 from towncrier._settings.load import ( # noqa: WPS433
9 ConfigError as TowncrierConfigError,
10 )
11 except ImportError:
12 # Towncrier < 22.8.0rc1
13 try: # noqa: WPS505
14 # Towncrier >= 19.9.0
15 from towncrier._settings import ( # noqa: WPS433, WPS440
16 ConfigError as TowncrierConfigError,
17 )
18 except ImportError:
19 # Towncrier < 19.9.0
20 TowncrierConfigError = ValueError # noqa: WPS440