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

chore: Refactor code quality issues #9649

Merged
merged 1 commit into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9649.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed some antipattern issues to improve code quality.
2 changes: 1 addition & 1 deletion scripts/move_remote_media_to_new_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def main(src_repo, dest_repo):
parts = line.split("|")
if len(parts) != 2:
print("Unable to parse input line %s" % line, file=sys.stderr)
exit(1)
sys.exit(1)

move_media(parts[0], parts[1], src_paths, dest_paths)

Expand Down
2 changes: 1 addition & 1 deletion synapse/push/httppusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ async def _process_one(self, push_action: dict) -> bool:
if rejected is False:
return False

if isinstance(rejected, list) or isinstance(rejected, tuple):
if isinstance(rejected, (list, tuple)):
for pk in rejected:
if pk != self.pushkey:
# for sanity, we only remove the pushkey if it
Expand Down
2 changes: 1 addition & 1 deletion synapse/util/frozenutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def freeze(o):

def unfreeze(o):
if isinstance(o, (dict, frozendict)):
return dict({k: unfreeze(v) for k, v in o.items()})
return {k: unfreeze(v) for k, v in o.items()}

if isinstance(o, (bytes, str)):
return o
Expand Down