]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-105751: Remove obsolete `object` base class in some ctypes tests (GH-107460...
authorŁukasz Langa <lukasz@langa.pl>
Mon, 31 Jul 2023 14:40:47 +0000 (14:40 +0000)
committerGitHub <noreply@github.com>
Mon, 31 Jul 2023 14:40:47 +0000 (16:40 +0200)
(cherry picked from commit 520efecfc3aed34d3a44545c7cd872d1aea8c7dc)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Lib/ctypes/test/test_as_parameter.py
Lib/ctypes/test/test_callbacks.py
Lib/ctypes/test/test_numbers.py
Lib/ctypes/test/test_parameters.py

index 9c39179d2a446a6ca739de29b16a9f09abe8ddcf..aaaf6e2ceb0e83b6c3129b45d3440a92f96f4ca3 100644 (file)
@@ -194,7 +194,7 @@ class BasicWrapTestCase(unittest.TestCase):
     def test_recursive_as_param(self):
         from ctypes import c_int
 
-        class A(object):
+        class A:
             pass
 
         a = A()
@@ -205,7 +205,7 @@ class BasicWrapTestCase(unittest.TestCase):
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-class AsParamWrapper(object):
+class AsParamWrapper:
     def __init__(self, param):
         self._as_parameter_ = param
 
@@ -214,7 +214,7 @@ class AsParamWrapperTestCase(BasicWrapTestCase):
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-class AsParamPropertyWrapper(object):
+class AsParamPropertyWrapper:
     def __init__(self, param):
         self._param = param
 
index 8e27359e4a8bf887c139d810377a555684f3aa6a..5c514db5114e932087a94070d6371f118c492ac0 100644 (file)
@@ -122,7 +122,7 @@ class Callbacks(unittest.TestCase):
     def test_issue_7959(self):
         proto = self.functype.__func__(None)
 
-        class X(object):
+        class X:
             def func(self): pass
             def __init__(self):
                 self.v = proto(self.func)
index dc5d4a713c5b00b20b11c58749908014a66a7b3b..a7696376a5ab056a107bbc49314eee22ee4760f5 100644 (file)
@@ -98,7 +98,7 @@ class NumberTestCase(unittest.TestCase):
     def test_floats(self):
         # c_float and c_double can be created from
         # Python int and float
-        class FloatLike(object):
+        class FloatLike:
             def __float__(self):
                 return 2.0
         f = FloatLike()
@@ -109,15 +109,15 @@ class NumberTestCase(unittest.TestCase):
             self.assertEqual(t(f).value, 2.0)
 
     def test_integers(self):
-        class FloatLike(object):
+        class FloatLike:
             def __float__(self):
                 return 2.0
         f = FloatLike()
-        class IntLike(object):
+        class IntLike:
             def __int__(self):
                 return 2
         d = IntLike()
-        class IndexLike(object):
+        class IndexLike:
             def __index__(self):
                 return 2
         i = IndexLike()
index 3fdc994e9078ce84a2c78ca694001183030c6235..59c94e3cc23cb5bd29c34db4c37776efda7f0a6c 100644 (file)
@@ -145,7 +145,7 @@ class SimpleTypesTestCase(unittest.TestCase):
         # TypeError: has no from_param method
         self.assertRaises(TypeError, setattr, func, "argtypes", (object,))
 
-        class Adapter(object):
+        class Adapter:
             def from_param(cls, obj):
                 return None
 
@@ -153,7 +153,7 @@ class SimpleTypesTestCase(unittest.TestCase):
         self.assertEqual(func(None), None)
         self.assertEqual(func(object()), None)
 
-        class Adapter(object):
+        class Adapter:
             def from_param(cls, obj):
                 return obj
 
@@ -162,7 +162,7 @@ class SimpleTypesTestCase(unittest.TestCase):
         self.assertRaises(ArgumentError, func, object())
         self.assertEqual(func(c_void_p(42)), 42)
 
-        class Adapter(object):
+        class Adapter:
             def from_param(cls, obj):
                 raise ValueError(obj)