From d9ba4e7d0577ea1d0c561ba12a1d51587c4f75b0 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Mon, 20 Jul 2026 13:19:35 +0000
Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---
studio/backend/core/inference/tools.py | 4 +---
studio/backend/tests/test_permission_mode.py | 12 +++++++++---
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/studio/backend/core/inference/tools.py b/studio/backend/core/inference/tools.py
index 17031b388d..74dd6ae717 100644
--- a/studio/backend/core/inference/tools.py
+++ b/studio/backend/core/inference/tools.py
@@ -767,9 +767,7 @@ def _sandbox_python_startup_bypasses_guard(
if _python_inline_payload(arguments) is None and _python_reads_program_from_stdin(
arguments
):
- if _python_payload_launches_startup_bypass(
- payload, depth + 1, environment_tainted
- ):
+ if _python_payload_launches_startup_bypass(payload, depth + 1, environment_tainted):
return True
# Preserve the previous fail-safe for nested shell bodies.
if _sandbox_python_startup_bypasses_guard(payload, depth + 1, environment_tainted):
diff --git a/studio/backend/tests/test_permission_mode.py b/studio/backend/tests/test_permission_mode.py
index bd3a690cac..547d1e8e73 100644
--- a/studio/backend/tests/test_permission_mode.py
+++ b/studio/backend/tests/test_permission_mode.py
@@ -954,7 +954,9 @@ def test_python_classifier(code, unsafe):
def test_python_runtime_safety_blocks_child_startup_guard_bypass():
from core.inference.tools import _check_code_safety
- assert _check_code_safety("import subprocess\nsubprocess.run(['python','-c','print(1)'])") is None
+ assert (
+ _check_code_safety("import subprocess\nsubprocess.run(['python','-c','print(1)'])") is None
+ )
assert (
_check_code_safety(
"import os, subprocess\n"
@@ -1133,7 +1135,9 @@ def test_render_html_gated_only_when_networked():
assert rh("") is False
assert rh("") is True
assert (
- rh("")
+ rh(
+ ""
+ )
is False
)
assert rh("") is False
@@ -1149,7 +1153,9 @@ def test_render_html_gated_only_when_networked():
assert rh("") is True
assert rh("") is False
assert (
- rh("")
+ rh(
+ ""
+ )
is True
)
assert (