Debian Codegraph @

pathspec/_backends/hyperscan/base.py

raw
1 """
2 This module provides the base implementation for the :module:`hyperscan`
3 backend.
4
5 WARNING: The *pathspec._backends.hyperscan* package is not part of the public
6 API. Its contents and structure are likely to change.
7 """
8 from __future__ import annotations
9
10 from typing import (
11 Optional) # Replaced by `X | None` in 3.10.
12
13 try:
14 import hyperscan
15 hyperscan_error = None
16 except ModuleNotFoundError as e:
17 hyperscan = None # type: ignore[assignment]
18 hyperscan_error = e.with_traceback(None)
19
20 hyperscan_error: Optional[ModuleNotFoundError] # type: ignore[no-redef]
21 """
22 *hyperscan_error* (:class:`ModuleNotFoundError` or :data:`None`) is the
23 hyperscan import error.
24 """