Skip to content

Commit 520efec

Browse files
authored
gh-105751: Remove obsolete object base class in some ctypes tests (#107460)
1 parent f57b9fd commit 520efec

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Lib/test/test_ctypes/test_as_parameter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class S8I(Structure):
192192
(9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9))
193193

194194
def test_recursive_as_param(self):
195-
class A(object):
195+
class A:
196196
pass
197197

198198
a = A()
@@ -201,15 +201,15 @@ class A(object):
201201
c_int.from_param(a)
202202

203203

204-
class AsParamWrapper(object):
204+
class AsParamWrapper:
205205
def __init__(self, param):
206206
self._as_parameter_ = param
207207

208208
class AsParamWrapperTestCase(BasicWrapTestCase):
209209
wrap = AsParamWrapper
210210

211211

212-
class AsParamPropertyWrapper(object):
212+
class AsParamPropertyWrapper:
213213
def __init__(self, param):
214214
self._param = param
215215

Lib/test/test_ctypes/test_callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_unsupported_restype_2(self):
120120
def test_issue_7959(self):
121121
proto = self.functype.__func__(None)
122122

123-
class X(object):
123+
class X:
124124
def func(self): pass
125125
def __init__(self):
126126
self.v = proto(self.func)

Lib/test/test_ctypes/test_numbers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_byref(self):
8686
def test_floats(self):
8787
# c_float and c_double can be created from
8888
# Python int and float
89-
class FloatLike(object):
89+
class FloatLike:
9090
def __float__(self):
9191
return 2.0
9292
f = FloatLike()
@@ -97,15 +97,15 @@ def __float__(self):
9797
self.assertEqual(t(f).value, 2.0)
9898

9999
def test_integers(self):
100-
class FloatLike(object):
100+
class FloatLike:
101101
def __float__(self):
102102
return 2.0
103103
f = FloatLike()
104-
class IntLike(object):
104+
class IntLike:
105105
def __int__(self):
106106
return 2
107107
d = IntLike()
108-
class IndexLike(object):
108+
class IndexLike:
109109
def __index__(self):
110110
return 2
111111
i = IndexLike()

Lib/test/test_ctypes/test_parameters.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ def test_noctypes_argtype(self):
157157
# TypeError: has no from_param method
158158
self.assertRaises(TypeError, setattr, func, "argtypes", (object,))
159159

160-
class Adapter(object):
160+
class Adapter:
161161
def from_param(cls, obj):
162162
return None
163163

164164
func.argtypes = (Adapter(),)
165165
self.assertEqual(func(None), None)
166166
self.assertEqual(func(object()), None)
167167

168-
class Adapter(object):
168+
class Adapter:
169169
def from_param(cls, obj):
170170
return obj
171171

@@ -174,7 +174,7 @@ def from_param(cls, obj):
174174
self.assertRaises(ArgumentError, func, object())
175175
self.assertEqual(func(c_void_p(42)), 42)
176176

177-
class Adapter(object):
177+
class Adapter:
178178
def from_param(cls, obj):
179179
raise ValueError(obj)
180180

0 commit comments

Comments
 (0)