diff --git a/python-stack-data.changes b/python-stack-data.changes index da2b425..12c591a 100644 --- a/python-stack-data.changes +++ b/python-stack-data.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 15 09:53:06 UTC 2023 - Steve Kowalik + +- Add patch support-typeguard-4.patch: + * Support typeguard 4+. + ------------------------------------------------------------------- Thu May 4 21:23:25 UTC 2023 - Dirk Müller diff --git a/python-stack-data.spec b/python-stack-data.spec index 1008f29..7f3fd72 100644 --- a/python-stack-data.spec +++ b/python-stack-data.spec @@ -24,6 +24,8 @@ Summary: Extract data from python stack frames and tracebacks License: MIT URL: https://github.com/alexmojaki/stack_data Source: https://files.pythonhosted.org/packages/source/s/stack_data/stack_data-%{version}.tar.gz +# PATCH-FIX-OPENSUSE Support typeguard 4+ +Patch0: support-typeguard-4.patch BuildRequires: %{python_module Cython} BuildRequires: %{python_module setuptools >= 44} BuildRequires: %{python_module setuptools_scm >= 3.4.3} diff --git a/support-typeguard-4.patch b/support-typeguard-4.patch new file mode 100644 index 0000000..39cb264 --- /dev/null +++ b/support-typeguard-4.patch @@ -0,0 +1,38 @@ +Index: stack_data-0.6.2/tests/__init__.py +=================================================================== +--- stack_data-0.6.2.orig/tests/__init__.py ++++ stack_data-0.6.2/tests/__init__.py +@@ -1,7 +1,7 @@ + import os + + import pyximport +-from typeguard.importhook import install_import_hook ++from typeguard import install_import_hook + + pyximport.install(language_level=3) + +Index: stack_data-0.6.2/stack_data/utils.py +=================================================================== +--- stack_data-0.6.2.orig/stack_data/utils.py ++++ stack_data-0.6.2/stack_data/utils.py +@@ -8,6 +8,11 @@ from typing import ( + TypeVar, Mapping, + ) + ++try: ++ from types import NoneType ++except ImportError: ++ NoneType = type(None) ++ + from asttokens import ASTText + + T = TypeVar('T') +@@ -91,7 +96,7 @@ def is_frame(frame_or_tb: Union[FrameTyp + return isinstance(frame_or_tb, (types.FrameType,)) + + +-def iter_stack(frame_or_tb: Union[FrameType, TracebackType]) -> Iterator[Union[FrameType, TracebackType]]: ++def iter_stack(frame_or_tb: Union[FrameType, TracebackType, NoneType]) -> Iterator[Union[FrameType, TracebackType]]: + while frame_or_tb: + yield frame_or_tb + if is_frame(frame_or_tb):