Skip to content

Commit 185e0fa

Browse files
committed
- apply simplification suggestion
1 parent abc32e4 commit 185e0fa

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ def test_UserString(self):
101101
add_abc_interface_tests(TestVerifyClass, collections.ISet.__module__)
102102

103103

104+
def _get_FrameLocalsProxy():
105+
return type(sys._getframe().f_locals)
106+
107+
104108
class TestVerifyObject(VerifyObjectMixin,
105109
TestVerifyClass):
106110
CONSTRUCTORS = {
@@ -130,11 +134,8 @@ class TestVerifyObject(VerifyObjectMixin,
130134
}
131135
if sys.version_info >= (3, 13):
132136
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])
137+
return _get_FrameLocalsProxy()(sys._getframe())
138+
FrameLocalsProxy = _get_FrameLocalsProxy()
138139
CONSTRUCTORS[FrameLocalsProxy] = FrameLocalsProxy_constructor
139140

140141
UNVERIFIABLE_RO = {

0 commit comments

Comments
 (0)