14
0

Accepting request 1203592 from home:glaubitz:branches:devel:languages:python

- Cherry-pick upstream patch to fix testsuite segfault with Python 3.13
  * fix-testsuite-segfault.patch

OBS-URL: https://build.opensuse.org/request/show/1203592
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zope.interface?expand=0&rev=72
This commit is contained in:
2024-09-26 18:20:07 +00:00
committed by Git OBS Bridge
parent 9d4622abff
commit 3c51ad07f1
3 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
diff --git a/src/zope/interface/common/tests/test_collections.py b/src/zope/interface/common/tests/test_collections.py
index 6d23f6f..122351a 100644
--- a/src/zope/interface/common/tests/test_collections.py
+++ b/src/zope/interface/common/tests/test_collections.py
@@ -12,6 +12,7 @@
import array
+import sys
import unittest
from collections import OrderedDict
from collections import abc
@@ -127,6 +128,12 @@ class TestVerifyObject(VerifyObjectMixin,
'async_generator': unittest.SkipTest,
type(iter(tuple())): lambda: iter(tuple()),
}
+ if sys.version_info >= (3, 13):
+ def FrameLocalsProxy_constructor():
+ FrameLocalsProxy = type([sys._getframe().f_locals for x in range(1)][0])
+ return FrameLocalsProxy(sys._getframe())
+ FrameLocalsProxy = type([sys._getframe().f_locals for x in range(1)][0])
+ CONSTRUCTORS[FrameLocalsProxy] = FrameLocalsProxy_constructor
UNVERIFIABLE_RO = {
# ``array.array`` fails the ``test_auto_ro_*`` tests with and

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Sep 25 13:39:50 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Cherry-pick upstream patch to fix testsuite segfault with Python 3.13
* fix-testsuite-segfault.patch
-------------------------------------------------------------------
Sun Sep 8 13:11:24 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@@ -33,6 +33,8 @@ Summary: Interfaces for Python
License: ZPL-2.1
URL: https://pypi.python.org/pypi/zope.interface
Source: https://files.pythonhosted.org/packages/source/z/zope.interface/%{modname}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM - gh/zopefoundation/zope.interface#323#issuecomment-2374076122 - Fix testsuite segfault with Python 3.13
Patch: https://github.com/zopefoundation/zope.interface/pull/324.patch#/fix-testsuite-segfault.patch
# needed for tests that try to compile things
BuildRequires: %{python_module devel >= 3.7}
BuildRequires: %{python_module pip}
@@ -61,6 +63,7 @@ the Design By Contract methodology support in Python.
%prep
%setup -q -n %{modname}-%{version}
%patch -P0 -p1
%build
%if !%{with test}