diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-01-15 15:17:10 -0500 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-01-15 16:33:10 -0500 |
commit | 0054cad5ad181cc51bbeae7583cf607bf72e851e (patch) | |
tree | 47d1f18ee45caddfd16143eaaaf650c75b0e2057 /gnu/packages/patches | |
parent | a6f49177c5f24fd17ae12281a1878ff5b79b8b8e (diff) | |
download | guix-0054cad5ad181cc51bbeae7583cf607bf72e851e.tar.gz guix-0054cad5ad181cc51bbeae7583cf607bf72e851e.zip |
gnu: python-typing-inspect: Fix build on Python 3.9.
* gnu/packages/patches/python-typing-inspect-fix.patch: Add patch.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/python-xyz.scm (python-typing-inspect)[patches]: Apply it.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/python-typing-inspect-fix.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-typing-inspect-fix.patch b/gnu/packages/patches/python-typing-inspect-fix.patch new file mode 100644 index 0000000000..e6e28981b7 --- /dev/null +++ b/gnu/packages/patches/python-typing-inspect-fix.patch @@ -0,0 +1,38 @@ +From 16919e21936179e53df2f376c8b59b5fc44bd2dd Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer <maxim.cournoyer@gmail.com> +Date: Fri, 15 Jan 2021 09:22:52 -0500 +Subject: [PATCH] Fix for Python 3.9+. + +Fixes <https://github.com/ilevkivskyi/typing_inspect/issues/60>. + +Based on an idea in +https://github.com/ilevkivskyi/typing_inspect/issues/60#issuecomment-683187584. +--- + typing_inspect.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/typing_inspect.py b/typing_inspect.py +index 1ca68ed..31d05ee 100644 +--- a/typing_inspect.py ++++ b/typing_inspect.py +@@ -21,7 +21,7 @@ LEGACY_TYPING = False + + if NEW_TYPING: + from typing import ( +- Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, ForwardRef ++ Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, _SpecialGenericAlias, ForwardRef + ) + from typing_extensions import Literal + else: +@@ -75,7 +75,7 @@ def is_generic_type(tp): + """ + if NEW_TYPING: + return (isinstance(tp, type) and issubclass(tp, Generic) or +- isinstance(tp, _GenericAlias) and ++ (isinstance(tp, _GenericAlias) or isinstance(tp, _SpecialGenericAlias)) and + tp.__origin__ not in (Union, tuple, ClassVar, collections.abc.Callable)) + return (isinstance(tp, GenericMeta) and not + isinstance(tp, (CallableMeta, TupleMeta))) +-- +2.29.2 + |