[Python-checkins] [3.12] gh-105751: Remove obsolete `object` base class in some ctypes tests (GH-107460) (#107501)

ambv webhook-mailer at python.org
Mon Jul 31 11:01:29 EDT 2023


https://github.com/python/cpython/commit/831fd19d30a4051d96117f42b625642ee8a250fb
commit: 831fd19d30a4051d96117f42b625642ee8a250fb
branch: 3.12
author: Łukasz Langa <lukasz at langa.pl>
committer: ambv <lukasz at langa.pl>
date: 2023-07-31T17:01:25+02:00
summary:

[3.12] gh-105751: Remove obsolete `object` base class in some ctypes tests (GH-107460) (#107501)

(cherry picked from commit 520efecfc3aed34d3a44545c7cd872d1aea8c7dc)

Co-authored-by: Tomas R <tomas.roun8 at gmail.com>

files:
M Lib/test/test_ctypes/test_as_parameter.py
M Lib/test/test_ctypes/test_callbacks.py
M Lib/test/test_ctypes/test_numbers.py
M Lib/test/test_ctypes/test_parameters.py

diff --git a/Lib/test/test_ctypes/test_as_parameter.py b/Lib/test/test_ctypes/test_as_parameter.py
index e9ec9ad847b48..36fec572b1674 100644
--- a/Lib/test/test_ctypes/test_as_parameter.py
+++ b/Lib/test/test_ctypes/test_as_parameter.py
@@ -194,7 +194,7 @@ class S8I(Structure):
     def test_recursive_as_param(self):
         from ctypes import c_int
 
-        class A(object):
+        class A:
             pass
 
         a = A()
@@ -205,7 +205,7 @@ class A(object):
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-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
 
diff --git a/Lib/test/test_ctypes/test_callbacks.py b/Lib/test/test_ctypes/test_callbacks.py
index 0069c640d7927..a9c6524b4d4ee 100644
--- a/Lib/test/test_ctypes/test_callbacks.py
+++ b/Lib/test/test_ctypes/test_callbacks.py
@@ -122,7 +122,7 @@ def test_unsupported_restype_2(self):
     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)
diff --git a/Lib/test/test_ctypes/test_numbers.py b/Lib/test/test_ctypes/test_numbers.py
index dc5d4a713c5b0..a7696376a5ab0 100644
--- a/Lib/test/test_ctypes/test_numbers.py
+++ b/Lib/test/test_ctypes/test_numbers.py
@@ -98,7 +98,7 @@ def test_byref(self):
     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 @@ def __float__(self):
             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()
diff --git a/Lib/test/test_ctypes/test_parameters.py b/Lib/test/test_ctypes/test_parameters.py
index 06cc95107b79f..f5afa76fd92a3 100644
--- a/Lib/test/test_ctypes/test_parameters.py
+++ b/Lib/test/test_ctypes/test_parameters.py
@@ -167,7 +167,7 @@ def test_noctypes_argtype(self):
         # 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
 
@@ -175,7 +175,7 @@ def from_param(cls, obj):
         self.assertEqual(func(None), None)
         self.assertEqual(func(object()), None)
 
-        class Adapter(object):
+        class Adapter:
             def from_param(cls, obj):
                 return obj
 
@@ -184,7 +184,7 @@ def from_param(cls, obj):
         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)
 



More information about the Python-checkins mailing list