Skip to content

Commit 831fd19

Browse files
ambvtomasr8
andauthored
[3.12] gh-105751: Remove obsolete object base class in some ctypes tests (GH-107460) (#107501)
(cherry picked from commit 520efec) Co-authored-by: Tomas R <tomas.roun8@gmail.com>
1 parent 99518bb commit 831fd19

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
@@ -194,7 +194,7 @@ class S8I(Structure):
194194
def test_recursive_as_param(self):
195195
from ctypes import c_int
196196

197-
class A(object):
197+
class A:
198198
pass
199199

200200
a = A()
@@ -205,7 +205,7 @@ class A(object):
205205

206206
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207207

208-
class AsParamWrapper(object):
208+
class AsParamWrapper:
209209
def __init__(self, param):
210210
self._as_parameter_ = param
211211

@@ -214,7 +214,7 @@ class AsParamWrapperTestCase(BasicWrapTestCase):
214214

215215
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216216

217-
class AsParamPropertyWrapper(object):
217+
class AsParamPropertyWrapper:
218218
def __init__(self, param):
219219
self._param = param
220220

Lib/test/test_ctypes/test_callbacks.py

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

125-
class X(object):
125+
class X:
126126
def func(self): pass
127127
def __init__(self):
128128
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
@@ -98,7 +98,7 @@ def test_byref(self):
9898
def test_floats(self):
9999
# c_float and c_double can be created from
100100
# Python int and float
101-
class FloatLike(object):
101+
class FloatLike:
102102
def __float__(self):
103103
return 2.0
104104
f = FloatLike()
@@ -109,15 +109,15 @@ def __float__(self):
109109
self.assertEqual(t(f).value, 2.0)
110110

111111
def test_integers(self):
112-
class FloatLike(object):
112+
class FloatLike:
113113
def __float__(self):
114114
return 2.0
115115
f = FloatLike()
116-
class IntLike(object):
116+
class IntLike:
117117
def __int__(self):
118118
return 2
119119
d = IntLike()
120-
class IndexLike(object):
120+
class IndexLike:
121121
def __index__(self):
122122
return 2
123123
i = IndexLike()

Lib/test/test_ctypes/test_parameters.py

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

170-
class Adapter(object):
170+
class Adapter:
171171
def from_param(cls, obj):
172172
return None
173173

174174
func.argtypes = (Adapter(),)
175175
self.assertEqual(func(None), None)
176176
self.assertEqual(func(object()), None)
177177

178-
class Adapter(object):
178+
class Adapter:
179179
def from_param(cls, obj):
180180
return obj
181181

@@ -184,7 +184,7 @@ def from_param(cls, obj):
184184
self.assertRaises(ArgumentError, func, object())
185185
self.assertEqual(func(c_void_p(42)), 42)
186186

187-
class Adapter(object):
187+
class Adapter:
188188
def from_param(cls, obj):
189189
raise ValueError(obj)
190190

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy