Skip to content

Commit d16f663

Browse files
authored
Merge pull request #328 from zopefoundation/dataflake/py_313_crashes
Fix segmentation fault and FrameLocalsProxy check
2 parents 6ffccef + 185e0fa commit d16f663

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
7.0.4 (unreleased)
66
==================
77

8+
- Fix segmentation faults on Python 3.13.
9+
(`#323 <https://github.com/zopefoundation/zope.interface/issues/323>`_)
10+
811

912
7.0.3 (2024-08-27)
1013
==================

src/zope/interface/common/tests/test_collections.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
import array
15+
import sys
1516
import unittest
1617
from collections import OrderedDict
1718
from collections import abc
@@ -100,6 +101,10 @@ def test_UserString(self):
100101
add_abc_interface_tests(TestVerifyClass, collections.ISet.__module__)
101102

102103

104+
def _get_FrameLocalsProxy():
105+
return type(sys._getframe().f_locals)
106+
107+
103108
class TestVerifyObject(VerifyObjectMixin,
104109
TestVerifyClass):
105110
CONSTRUCTORS = {
@@ -127,6 +132,11 @@ class TestVerifyObject(VerifyObjectMixin,
127132
'async_generator': unittest.SkipTest,
128133
type(iter(tuple())): lambda: iter(tuple()),
129134
}
135+
if sys.version_info >= (3, 13):
136+
def FrameLocalsProxy_constructor():
137+
return _get_FrameLocalsProxy()(sys._getframe())
138+
FrameLocalsProxy = _get_FrameLocalsProxy()
139+
CONSTRUCTORS[FrameLocalsProxy] = FrameLocalsProxy_constructor
130140

131141
UNVERIFIABLE_RO = {
132142
# ``array.array`` fails the ``test_auto_ro_*`` tests with and

0 commit comments

Comments
 (0)