Skip to content

Commit 2f0e725

Browse files
committed
ruff
1 parent 9735516 commit 2f0e725

File tree

1 file changed

+3
-6
lines changed
  • openhands-tools/openhands/tools/file_editor

1 file changed

+3
-6
lines changed

openhands-tools/openhands/tools/file_editor/editor.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def view(
340340
with open(path, "rb") as f:
341341
image_bytes = f.read()
342342
image_base64 = base64.b64encode(image_bytes).decode("utf-8")
343-
343+
344344
mime_type = "image/png" # default
345345
if image_base64.startswith("/9j/"):
346346
mime_type = "image/jpeg"
@@ -353,8 +353,7 @@ def view(
353353
elif image_base64.startswith("Qk"):
354354
mime_type = "image/bmp"
355355
output_msg = (
356-
f"Image file {path} read successfully. "
357-
"Displaying image content."
356+
f"Image file {path} read successfully. Displaying image content."
358357
)
359358
image_url = f"data:{mime_type};base64,{image_base64}"
360359
return FileEditorObservation(
@@ -367,9 +366,7 @@ def view(
367366
prev_exist=True,
368367
)
369368
except Exception as e:
370-
raise ToolError(
371-
f"Failed to read image file {path}: {e}"
372-
) from None
369+
raise ToolError(f"Failed to read image file {path}: {e}") from None
373370

374371
# Validate file and count lines
375372
self.validate_file(path)

0 commit comments

Comments
 (0)