- Add patch support-typeguard-4.patch:

* Support typeguard 4+.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-stack-data?expand=0&rev=11
This commit is contained in:
Steve Kowalik 2023-05-15 09:53:40 +00:00 committed by Git OBS Bridge
parent 791e03110a
commit 3118f4dda0
3 changed files with 46 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon May 15 09:53:06 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-typeguard-4.patch:
* Support typeguard 4+.
-------------------------------------------------------------------
Thu May 4 21:23:25 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@ -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}

38
support-typeguard-4.patch Normal file
View File

@ -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):