File: py314.patch

package info (click to toggle)
python-typing-extensions 4.15.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 976 kB
  • sloc: python: 9,753; sh: 8; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 1,739 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Date: Thu, 18 Sep 2025 21:03:16 -0700
Subject: fix test on 3.14

Origin: upstream, https://github.com/python/typing_extensions/pull/683
Bug: https://github.com/python/typing_extensions/issues/682
Bug-Debian: https://bugs.debian.org/1123325
Last-Update: 2025-12-17
---
 src/test_typing_extensions.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/test_typing_extensions.py b/src/test_typing_extensions.py
index 0986427..eb28630 100644
--- a/src/test_typing_extensions.py
+++ b/src/test_typing_extensions.py
@@ -4438,8 +4438,12 @@ class TypedDictTests(BaseTestCase):
                     child = _make_td(
                         child_future, "Child", {"child": "int"}, "Base", {"Base": base}
                     )
-                    base_anno = typing.ForwardRef("int", module="builtins") if base_future else int
-                    child_anno = typing.ForwardRef("int", module="builtins") if child_future else int
+                    if sys.version_info >= (3, 14):
+                        base_anno = typing.ForwardRef("int", module="builtins", owner=base) if base_future else int
+                        child_anno = typing.ForwardRef("int", module="builtins", owner=child) if child_future else int
+                    else:
+                        base_anno = typing.ForwardRef("int", module="builtins") if base_future else int
+                        child_anno = typing.ForwardRef("int", module="builtins") if child_future else int
                     self.assertEqual(base.__annotations__, {'base': base_anno})
                     self.assertEqual(
                         child.__annotations__, {'child': child_anno, 'base': base_anno}