Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

ci: enable Ruff E722 (#44098)

Asuka Minato03dfb4753ed3
diff --git a/api/.ruff.toml b/api/.ruff.toml
index 55c1bdb3dbe..da5a1b70a08 100644
--- a/api/.ruff.toml
+++ b/api/.ruff.toml
@@ -60,7 +60,6 @@ select = [
ignore = [
"E402", # module-import-not-at-top-of-file
"E712", # true-false-comparison
- "E722", # bare-except
"F821", # undefined-name
"F841", # unused-variable
"FURB113", # repeated-append
diff --git a/api/providers/vdb/vdb-clickzetta/tests/integration_tests/test_docker_integration.py b/api/providers/vdb/vdb-clickzetta/tests/integration_tests/test_docker_integration.py
index a5d32f5e81c..33a023597de 100644
--- a/api/providers/vdb/vdb-clickzetta/tests/integration_tests/test_docker_integration.py
+++ b/api/providers/vdb/vdb-clickzetta/tests/integration_tests/test_docker_integration.py
@@ -68,7 +68,7 @@ def test_dify_api():
if response.status_code == 200:
logger.info("✓ Dify API is ready")
break
- except:
+ except BaseException:
if i == max_retries - 1:
logger.exception("✗ Dify API is not responding")
return False
diff --git a/api/tests/unit_tests/core/mcp/session/test_base_session.py b/api/tests/unit_tests/core/mcp/session/test_base_session.py
index 29bd2208712..50204738d37 100644
--- a/api/tests/unit_tests/core/mcp/session/test_base_session.py
+++ b/api/tests/unit_tests/core/mcp/session/test_base_session.py
@@ -189,7 +189,7 @@ def test_send_request_retry_loop_coverage(streams):
time.sleep(0.2)
response = JSONRPCResponse(jsonrpc="2.0", id=req_id, result={"result": "slow"})
read_stream.put(SessionMessage(message=JSONRPCMessage(response)))
- except:
+ except BaseException:
pass
import threading
@@ -215,7 +215,7 @@ def test_send_request_jsonrpc_error(streams):
req_id = msg.message.root.id
error = JSONRPCError(jsonrpc="2.0", id=req_id, error=ErrorData(code=-32000, message="Error"))
read_stream.put(SessionMessage(message=JSONRPCMessage(error)))
- except:
+ except BaseException:
pass
import threading
@@ -242,7 +242,7 @@ def test_send_request_auth_error(streams):
req_id = msg.message.root.id
error = JSONRPCError(jsonrpc="2.0", id=req_id, error=ErrorData(code=401, message="Unauthorized"))
read_stream.put(SessionMessage(message=JSONRPCMessage(error)))
- except:
+ except BaseException:
pass
import threading
@@ -271,7 +271,7 @@ def test_send_request_http_status_error_coverage(streams):
response = Response(status_code=403, request=Request("GET", "http://test"))
error = HTTPStatusError("Forbidden", request=response.request, response=response)
session._response_streams[req_id].put(error)
- except:
+ except BaseException:
pass
import threading
@@ -300,7 +300,7 @@ def test_send_request_http_status_auth_error(streams):
response = Response(status_code=401, request=Request("GET", "http://test"))
error = HTTPStatusError("Unauthorized", request=response.request, response=response)
read_stream.put(error)
- except:
+ except BaseException:
pass
import threading
@@ -468,7 +468,7 @@ def test_check_receiver_status_fail(streams):
try:
future.result()
- except:
+ except BaseException:
pass
with pytest.raises(RuntimeError, match="Receiver failed"):
@@ -536,7 +536,7 @@ def test_send_request_none_response(streams):
msg = write_stream.get(timeout=2)
req_id = msg.message.root.id
session._response_streams[req_id].put(None)
- except:
+ except BaseException:
pass
import threading