Skip to content

Commit

Permalink
Merge pull request #328 from zopefoundation/dataflake/py_313_crashes
Browse files Browse the repository at this point in the history
Fix segmentation fault and FrameLocalsProxy check
  • Loading branch information
dataflake authored Oct 4, 2024
2 parents 6ffccef + 185e0fa commit d16f663
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
7.0.4 (unreleased)
==================

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


7.0.3 (2024-08-27)
==================
Expand Down
10 changes: 10 additions & 0 deletions src/zope/interface/common/tests/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@


import array
import sys
import unittest
from collections import OrderedDict
from collections import abc
Expand Down Expand Up @@ -100,6 +101,10 @@ def test_UserString(self):
add_abc_interface_tests(TestVerifyClass, collections.ISet.__module__)


def _get_FrameLocalsProxy():
return type(sys._getframe().f_locals)


class TestVerifyObject(VerifyObjectMixin,
TestVerifyClass):
CONSTRUCTORS = {
Expand Down Expand Up @@ -127,6 +132,11 @@ class TestVerifyObject(VerifyObjectMixin,
'async_generator': unittest.SkipTest,
type(iter(tuple())): lambda: iter(tuple()),
}
if sys.version_info >= (3, 13):
def FrameLocalsProxy_constructor():
return _get_FrameLocalsProxy()(sys._getframe())
FrameLocalsProxy = _get_FrameLocalsProxy()
CONSTRUCTORS[FrameLocalsProxy] = FrameLocalsProxy_constructor

UNVERIFIABLE_RO = {
# ``array.array`` fails the ``test_auto_ro_*`` tests with and
Expand Down

0 comments on commit d16f663

Please sign in to comment.