Skip to content

Commit 1b40431

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

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Lib/ctypes/test/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/ctypes/test/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/ctypes/test/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/ctypes/test/test_parameters.py

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

148-
class Adapter(object):
148+
class Adapter:
149149
def from_param(cls, obj):
150150
return None
151151

152152
func.argtypes = (Adapter(),)
153153
self.assertEqual(func(None), None)
154154
self.assertEqual(func(object()), None)
155155

156-
class Adapter(object):
156+
class Adapter:
157157
def from_param(cls, obj):
158158
return obj
159159

@@ -162,7 +162,7 @@ def from_param(cls, obj):
162162
self.assertRaises(ArgumentError, func, object())
163163
self.assertEqual(func(c_void_p(42)), 42)
164164

165-
class Adapter(object):
165+
class Adapter:
166166
def from_param(cls, obj):
167167
raise ValueError(obj)
168168

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