mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-25 03:48:27 -04:00
Simplify super() calls to Python 3 syntax. (#8344)
This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
This commit is contained in:
parent
68c7a6936f
commit
8a4a4186de
133 changed files with 272 additions and 281 deletions
|
@ -30,7 +30,7 @@ from tests import unittest, utils
|
|||
|
||||
class E2eKeysHandlerTestCase(unittest.TestCase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(E2eKeysHandlerTestCase, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.hs = None # type: synapse.server.HomeServer
|
||||
self.handler = None # type: synapse.handlers.e2e_keys.E2eKeysHandler
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ room_keys = {
|
|||
|
||||
class E2eRoomKeysHandlerTestCase(unittest.TestCase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(E2eRoomKeysHandlerTestCase, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.hs = None # type: synapse.server.HomeServer
|
||||
self.handler = None # type: synapse.handlers.e2e_keys.E2eRoomKeysHandler
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class SlavedEventStoreTestCase(BaseSlavedStoreTestCase):
|
|||
# Patch up the equality operator for events so that we can check
|
||||
# whether lists of events match using assertEquals
|
||||
self.unpatches = [patch__eq__(_EventInternalMetadata), patch__eq__(FrozenEvent)]
|
||||
return super(SlavedEventStoreTestCase, self).setUp()
|
||||
return super().setUp()
|
||||
|
||||
def prepare(self, *args, **kwargs):
|
||||
super().prepare(*args, **kwargs)
|
||||
|
|
|
@ -21,7 +21,7 @@ from tests import unittest
|
|||
|
||||
class WellKnownTests(unittest.HomeserverTestCase):
|
||||
def setUp(self):
|
||||
super(WellKnownTests, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
# replace the JsonResource with a WellKnownResource
|
||||
self.resource = WellKnownResource(self.hs)
|
||||
|
|
|
@ -260,7 +260,7 @@ class ThreadedMemoryReactorClock(MemoryReactorClock):
|
|||
return succeed(lookups[name])
|
||||
|
||||
self.nameResolver = SimpleResolverComplexifier(FakeResolver())
|
||||
super(ThreadedMemoryReactorClock, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
def listenUDP(self, port, protocol, interface="", maxPacketSize=8196):
|
||||
p = udp.Port(port, protocol, interface, maxPacketSize, self)
|
||||
|
|
|
@ -413,7 +413,7 @@ class ApplicationServiceTransactionStoreTestCase(unittest.TestCase):
|
|||
# required for ApplicationServiceTransactionStoreTestCase tests
|
||||
class TestTransactionStore(ApplicationServiceTransactionStore, ApplicationServiceStore):
|
||||
def __init__(self, database: DatabasePool, db_conn, hs):
|
||||
super(TestTransactionStore, self).__init__(database, db_conn, hs)
|
||||
super().__init__(database, db_conn, hs)
|
||||
|
||||
|
||||
class ApplicationServiceStoreConfigTestCase(unittest.TestCase):
|
||||
|
|
|
@ -23,7 +23,7 @@ import tests.utils
|
|||
|
||||
class DeviceStoreTestCase(tests.unittest.TestCase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(DeviceStoreTestCase, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.store = None # type: synapse.storage.DataStore
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
|
|
@ -125,7 +125,7 @@ class StateGroupStore:
|
|||
|
||||
class DictObj(dict):
|
||||
def __init__(self, **kwargs):
|
||||
super(DictObj, self).__init__(kwargs)
|
||||
super().__init__(kwargs)
|
||||
self.__dict__ = self
|
||||
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ class TestCase(unittest.TestCase):
|
|||
root logger's logging level while that test (case|method) runs."""
|
||||
|
||||
def __init__(self, methodName, *args, **kwargs):
|
||||
super(TestCase, self).__init__(methodName, *args, **kwargs)
|
||||
super().__init__(methodName, *args, **kwargs)
|
||||
|
||||
method = getattr(self, methodName)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue