Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Remove unnecessary pass statements. (#12206)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored Mar 11, 2022
1 parent 3b12f6d commit bc9dff1
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 15 deletions.
1 change: 1 addition & 0 deletions changelog.d/12206.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unnecessary `pass` statements.
2 changes: 0 additions & 2 deletions synapse/handlers/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ async def delete_device(self, user_id: str, device_id: str) -> None:
log_kv(
{"reason": "User doesn't have device id.", "device_id": device_id}
)
pass
else:
raise

Expand Down Expand Up @@ -414,7 +413,6 @@ async def delete_devices(self, user_id: str, device_ids: List[str]) -> None:
# no match
set_tag("error", True)
set_tag("reason", "User doesn't have that device id.")
pass
else:
raise

Expand Down
2 changes: 0 additions & 2 deletions synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ async def update_external_syncs_row(
is_syncing: Whether or not the user is now syncing
sync_time_msec: Time in ms when the user was last syncing
"""
pass

async def update_external_syncs_clear(self, process_id: str) -> None:
"""Marks all users that had been marked as syncing by a given process
Expand All @@ -277,7 +276,6 @@ async def update_external_syncs_clear(self, process_id: str) -> None:
This is a no-op when presence is handled by a different worker.
"""
pass

async def process_replication_rows(
self, stream_name: str, instance_name: str, token: int, rows: list
Expand Down
2 changes: 0 additions & 2 deletions synapse/http/matrixfederationclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def finish(self) -> T:
"""Called when response has finished streaming and the parser should
return the final result (or error).
"""
pass


@attr.s(slots=True, frozen=True, auto_attribs=True)
Expand Down Expand Up @@ -601,7 +600,6 @@ async def _send_request(
response.code,
response_phrase,
)
pass
else:
logger.info(
"{%s} [%s] Got response headers: %d %s",
Expand Down
1 change: 0 additions & 1 deletion synapse/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ def register_paths(
servlet_classname (str): The name of the handler to be used in prometheus
and opentracing logs.
"""
pass


class _AsyncResource(resource.Resource, metaclass=abc.ABCMeta):
Expand Down
1 change: 0 additions & 1 deletion synapse/rest/media/v1/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ def write_to_consumer(self, consumer: IConsumer) -> Awaitable:
Returns:
Resolves once the response has finished being written
"""
pass

def __enter__(self) -> None:
pass
Expand Down
1 change: 0 additions & 1 deletion synapse/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ def start_listening(self) -> None:
Does nothing in this base class; overridden in derived classes to start the
appropriate listeners.
"""
pass

def setup_background_tasks(self) -> None:
"""
Expand Down
2 changes: 0 additions & 2 deletions synapse/storage/databases/main/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class ExternalIDReuseException(Exception):
"""Exception if writing an external id for a user fails,
because this external id is given to an other user."""

pass


@attr.s(frozen=True, slots=True, auto_attribs=True)
class TokenLookupResult:
Expand Down
1 change: 0 additions & 1 deletion synapse/storage/schema/main/delta/30/as_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def run_upgrade(cur, database_engine, config, *args, **kwargs):
config_files = config.appservice.app_service_config_files
except AttributeError:
logger.warning("Could not get app_service_config_files from config")
pass

appservices = load_appservices(config.server.server_name, config_files)

Expand Down
2 changes: 0 additions & 2 deletions synapse/util/caches/treecache.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class TreeCacheNode(dict):
leaves.
"""

pass


class TreeCache:
"""
Expand Down
1 change: 0 additions & 1 deletion tests/handlers/test_password_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def __init__(self, config, api: ModuleApi):
("m.login.password", ("password",)): self.check_auth,
}
)
pass

def check_auth(self, *args):
return mock_password_provider.check_auth(*args)
Expand Down

0 comments on commit bc9dff1

Please sign in to comment.