14
0

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

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