Skip to content

Commit abc32e4

Browse files
committed
- fix segmentation fault and FrameLocalsProxy check
1 parent 6ffccef commit abc32e4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-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: 9 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
@@ -127,6 +128,14 @@ class TestVerifyObject(VerifyObjectMixin,
127128
'async_generator': unittest.SkipTest,
128129
type(iter(tuple())): lambda: iter(tuple()),
129130
}
131+
if sys.version_info >= (3, 13):
132+
def FrameLocalsProxy_constructor():
133+
FrameLocalsProxy = type([sys._getframe().f_locals for x in
134+
range(1)][0])
135+
return FrameLocalsProxy(sys._getframe())
136+
FrameLocalsProxy = type([sys._getframe().f_locals for x in
137+
range(1)][0])
138+
CONSTRUCTORS[FrameLocalsProxy] = FrameLocalsProxy_constructor
130139

131140
UNVERIFIABLE_RO = {
132141
# ``array.array`` fails the ``test_auto_ro_*`` tests with and

0 commit comments

Comments
 (0)