Python code modernization, 3/n (#1157)

* Remove __metaclass__ = type.

for i in $(grep -REl '__metaclass__ = type' plugins/ tests/); do
  sed -e '/^__metaclass__ = type/d' -i $i;
done

* Remove super arguments, and stop inheriting from object.
This commit is contained in:
Felix Fontein
2025-10-10 08:11:58 +02:00
committed by GitHub
parent 741c318b1d
commit e8ec22d3b1
99 changed files with 129 additions and 245 deletions
+6 -6
View File
@@ -30,10 +30,10 @@ try:
except ImportError:
REQUESTS_IMPORT_ERROR = traceback.format_exc()
class Session(object):
class Session:
__attrs__ = []
class HTTPAdapter(object):
class HTTPAdapter:
__attrs__ = []
class HTTPError(Exception):
@@ -57,13 +57,13 @@ except ImportError:
except ImportError:
URLLIB3_IMPORT_ERROR = traceback.format_exc()
class _HTTPConnectionPool(object):
class _HTTPConnectionPool:
pass
class _HTTPConnection(object):
class _HTTPConnection:
pass
class FakeURLLIB3(object):
class FakeURLLIB3:
def __init__(self):
self._collections = self
self.poolmanager = self
@@ -75,7 +75,7 @@ except ImportError:
self.match_hostname = object()
self.HTTPConnectionPool = _HTTPConnectionPool
class FakeURLLIB3Connection(object):
class FakeURLLIB3Connection:
def __init__(self):
self.HTTPConnection = _HTTPConnection