Skip to content

Commit 63246e4

Browse files
committed
ruff: Fix RUF010 Use explicit conversion flag.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 52a7b0b commit 63246e4

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

zulip/integrations/bridge_with_matrix/matrix_bridge.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async def create(
9191
return matrix_to_zulip
9292

9393
async def _matrix_to_zulip(self, room: nio.MatrixRoom, event: nio.Event) -> None:
94-
logging.debug(f"_matrix_to_zulip; room {str(room.room_id)}, event: {str(event)}")
94+
logging.debug(f"_matrix_to_zulip; room {room.room_id}, event: {event}")
9595

9696
# We do this to identify the messages generated from Zulip -> Matrix
9797
# and we make sure we don't forward it again to the Zulip stream.
@@ -253,7 +253,7 @@ def _matrix_send(self, **kwargs: Any) -> None:
253253
raise Bridge_FatalMatrixException(str(result))
254254

255255
def _zulip_to_matrix(self, msg: Dict[str, Any]) -> None:
256-
logging.debug(f"_zulip_to_matrix; msg: {str(msg)}")
256+
logging.debug(f"_zulip_to_matrix; msg: {msg}")
257257

258258
room_id: Optional[str] = self.get_matrix_room_for_zulip_message(msg)
259259
if room_id is None:
@@ -485,7 +485,7 @@ def read_configuration(config_file: str) -> Dict[str, Dict[str, Any]]:
485485
if section.startswith("additional_bridge"):
486486
if section_keys != bridge_key_set:
487487
raise Bridge_ConfigException(
488-
f"Please ensure the bridge configuration section {section} contain the following keys: {str(bridge_key_set)}."
488+
f"Please ensure the bridge configuration section {section} contain the following keys: {bridge_key_set}."
489489
)
490490

491491
zulip_target = (section_config["stream"], section_config["topic"])

zulip/integrations/codebase/zulip_codebase_mirror

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def run_mirror() -> None:
282282
else:
283283
since = datetime.fromtimestamp(float(timestamp), tz=pytz.utc)
284284
except (ValueError, OSError) as e:
285-
logging.warn(f"Could not open resume file: {str(e)}")
285+
logging.warn(f"Could not open resume file: {e}")
286286
since = default_since()
287287

288288
try:

zulip/integrations/zephyr/zephyr_mirror_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def send_zulip(zulip_client: zulip.Client, zeph: ZephyrDict) -> Dict[str, Any]:
160160
message["content"] = unwrap_lines(zeph["content"])
161161

162162
if options.test_mode and options.site == DEFAULT_SITE:
163-
logger.debug(f"Message is: {str(message)}")
163+
logger.debug(f"Message is: {message}")
164164
return {"result": "success"}
165165

166166
return zulip_client.send_message(message)

zulip_bots/zulip_bots/bots/dialogflow/dialogflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_bot_result(message_content: str, config: Dict[str, str], sender_id: str)
3636
return res_json["result"]["fulfillment"]["speech"]
3737
except Exception as e:
3838
logging.exception(str(e))
39-
return f"Error. {str(e)}."
39+
return f"Error. {e}."
4040

4141

4242
class DialogFlowHandler:

zulip_bots/zulip_bots/lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def put(self, key: str, value: Any) -> None:
145145
self.state_[key] = self.marshal(value)
146146
response = self._client.update_storage({"storage": {key: self.state_[key]}})
147147
if response["result"] != "success":
148-
raise StateHandlerError(f"Error updating state: {str(response)}")
148+
raise StateHandlerError(f"Error updating state: {response}")
149149

150150
def get(self, key: str) -> Any:
151151
if key in self.state_:

0 commit comments

Comments
 (0)