diff --git a/pdoc/doc_types.py b/pdoc/doc_types.py index 8be7df2f..6ca7f8ca 100644 --- a/pdoc/doc_types.py +++ b/pdoc/doc_types.py @@ -114,7 +114,7 @@ def safe_eval_type( f"Error parsing type annotation {t} for {fullname}: {e}. " f"You are likely attempting to use Python 3.10 syntax (PEP 604 union types) with an older Python " f"release. `X | Y`-style type annotations are invalid syntax on Python {py_ver}, which is what your " - f"pdoc instance is using. `from future import __annotations__` (PEP 563) postpones evaluation of " + f"pdoc instance is using. `from __future__ import annotations` (PEP 563) postpones evaluation of " f"annotations, which is why your program won't crash right away. However, pdoc needs to evaluate your " f"type annotations and is unable to do so on Python {py_ver}. To fix this issue, either invoke pdoc " f"from Python 3.10+, or switch to `typing.Union[]` syntax."