From 031d0c166b6725edd137dd22ea0815a8c305401e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 13 Jun 2024 21:33:32 +0200 Subject: Merging debian version 7.3.7-2. Signed-off-by: Daniel Baumann --- debian/patches/python_3.12.4.diff | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 debian/patches/python_3.12.4.diff (limited to 'debian/patches/python_3.12.4.diff') diff --git a/debian/patches/python_3.12.4.diff b/debian/patches/python_3.12.4.diff new file mode 100644 index 0000000..9e7d09a --- /dev/null +++ b/debian/patches/python_3.12.4.diff @@ -0,0 +1,33 @@ +From: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> +Date: Tue, 23 Apr 2024 20:25:34 +0200 +Subject: Fix `sphinx.util.inspect_evaluate_forwardref` for Python 3.12.4 + (#12317) + +Python has recently [1] changed the signature of `_evaluate` for forward references +because of type parameters. The change affects 3.13, and was backported to 3.12.4. + +[1]: https://github.com/python/cpython/pull/118104 + +(cherry picked from commit b5f3ef987ab5c2147d651ad84cc7d72c84ac6acc) +--- + sphinx/util/inspect.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py +index 6b13b29..dfb4e40 100644 +--- a/sphinx/util/inspect.py ++++ b/sphinx/util/inspect.py +@@ -681,6 +681,13 @@ def _evaluate_forwardref( + localns: dict[str, Any] | None, + ) -> Any: + """Evaluate a forward reference.""" ++ if sys.version_info >= (3, 12, 4): ++ # ``type_params`` were added in 3.13 and the signature of _evaluate() ++ # is not backward-compatible (it was backported to 3.12.4, so anything ++ # before 3.12.4 still has the old signature). ++ # ++ # See: https://github.com/python/cpython/pull/118104. ++ return ref._evaluate(globalns, localns, {}, recursive_guard=frozenset()) # type: ignore[arg-type, misc] + return ref._evaluate(globalns, localns, frozenset()) + + -- cgit v1.2.3