diff options
author | Richard van der Hoff <richard@matrix.org> | 2020-05-15 19:18:22 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2020-05-15 19:37:41 +0100 |
commit | 91f51c611c86ff7e85b20b6acb0b1025b65edcdf (patch) | |
tree | 93c254a9c3e560352c9f7208f6dbfa844afa101a /synapse/replication/slave/storage | |
parent | remove to_ascii (diff) | |
download | synapse-91f51c611c86ff7e85b20b6acb0b1025b65edcdf.tar.xz |
remove redundant `__func__`
this is a no-op under python 3
Diffstat (limited to 'synapse/replication/slave/storage')
-rw-r--r-- | synapse/replication/slave/storage/_base.py | 9 | ||||
-rw-r--r-- | synapse/replication/slave/storage/presence.py | 8 |
2 files changed, 4 insertions, 13 deletions
diff --git a/synapse/replication/slave/storage/_base.py b/synapse/replication/slave/storage/_base.py index 2904bd0235..f9e2533e96 100644 --- a/synapse/replication/slave/storage/_base.py +++ b/synapse/replication/slave/storage/_base.py @@ -16,8 +16,6 @@ import logging from typing import Optional -import six - from synapse.storage.data_stores.main.cache import CacheInvalidationWorkerStore from synapse.storage.database import Database from synapse.storage.engines import PostgresEngine @@ -26,13 +24,6 @@ from synapse.storage.util.id_generators import MultiWriterIdGenerator logger = logging.getLogger(__name__) -def __func__(inp): - if six.PY3: - return inp - else: - return inp.__func__ - - class BaseSlavedStore(CacheInvalidationWorkerStore): def __init__(self, database: Database, db_conn, hs): super(BaseSlavedStore, self).__init__(database, db_conn, hs) diff --git a/synapse/replication/slave/storage/presence.py b/synapse/replication/slave/storage/presence.py index bd79ba99be..4e0124842d 100644 --- a/synapse/replication/slave/storage/presence.py +++ b/synapse/replication/slave/storage/presence.py @@ -18,7 +18,7 @@ from synapse.storage.data_stores.main.presence import PresenceStore from synapse.storage.database import Database from synapse.util.caches.stream_change_cache import StreamChangeCache -from ._base import BaseSlavedStore, __func__ +from ._base import BaseSlavedStore from ._slaved_id_tracker import SlavedIdTracker @@ -27,14 +27,14 @@ class SlavedPresenceStore(BaseSlavedStore): super(SlavedPresenceStore, self).__init__(database, db_conn, hs) self._presence_id_gen = SlavedIdTracker(db_conn, "presence_stream", "stream_id") - self._presence_on_startup = self._get_active_presence(db_conn) + self._presence_on_startup = self._get_active_presence(db_conn) # type: ignore self.presence_stream_cache = StreamChangeCache( "PresenceStreamChangeCache", self._presence_id_gen.get_current_token() ) - _get_active_presence = __func__(DataStore._get_active_presence) - take_presence_startup_info = __func__(DataStore.take_presence_startup_info) + _get_active_presence = DataStore._get_active_presence + take_presence_startup_info = DataStore.take_presence_startup_info _get_presence_for_user = PresenceStore.__dict__["_get_presence_for_user"] get_presence_for_users = PresenceStore.__dict__["get_presence_for_users"] |