unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 29321d89187028a40941c10a1ada1e68c05127be 1557 bytes (raw)
name: packages/patches/python-typeguard-python3.10.patch 	 # note: path name is non-authoritative(*)

 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 
Taken from Gentoo, which adapted
https://github.com/agronholm/typeguard/commit/e0db07a777d5a481eaba6162354adf32286ce21b

diff --git a/src/typeguard/__init__.py b/src/typeguard/__init__.py
index 5684d63..27fa30b 100644
--- a/src/typeguard/__init__.py
+++ b/src/typeguard/__init__.py
@@ -61,22 +61,25 @@ except ImportError:
     from typing import _ForwardRef as ForwardRef
     evaluate_forwardref = ForwardRef._eval_type
 
-if sys.version_info >= (3, 10):
-    from typing import is_typeddict
-else:
-    _typed_dict_meta_types = ()
-    if sys.version_info >= (3, 8):
-        from typing import _TypedDictMeta
-        _typed_dict_meta_types += (_TypedDictMeta,)
+try:
+    from typing_extensions import is_typeddict
+except ImportError:
+    if sys.version_info >= (3, 10):
+        from typing import is_typeddict
+    else:
+        _typed_dict_meta_types = ()
+        if sys.version_info >= (3, 8):
+            from typing import _TypedDictMeta
+            _typed_dict_meta_types += (_TypedDictMeta,)
 
-    try:
-        from typing_extensions import _TypedDictMeta
-        _typed_dict_meta_types += (_TypedDictMeta,)
-    except ImportError:
-        pass
+        try:
+            from typing_extensions import _TypedDictMeta
+            _typed_dict_meta_types += (_TypedDictMeta,)
+        except ImportError:
+            pass
 
-    def is_typeddict(tp) -> bool:
-        return isinstance(tp, _typed_dict_meta_types)
+        def is_typeddict(tp) -> bool:
+            return isinstance(tp, _typed_dict_meta_types)
 
 
 if TYPE_CHECKING:

debug log:

solving 29321d89187028a40941c10a1ada1e68c05127be ...
found 29321d89187028a40941c10a1ada1e68c05127be in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).