Enable Ruff TRY201 (#114269)

* Enable Ruff TRY201

* remove redundant rules
This commit is contained in:
Sid 2024-03-28 10:18:07 +01:00 committed by GitHub
parent 071c3abb69
commit f7b7f74d10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 71 additions and 66 deletions

View file

@ -240,16 +240,16 @@ async def trace_action(
yield trace_element
except _AbortScript as ex:
trace_element.set_error(ex.__cause__ or ex)
raise ex
except _ConditionFail as ex:
raise
except _ConditionFail:
# Clear errors which may have been set when evaluating the condition
trace_element.set_error(None)
raise ex
except _StopScript as ex:
raise ex
raise
except _StopScript:
raise
except Exception as ex:
trace_element.set_error(ex)
raise ex
raise
finally:
trace_stack_pop(trace_stack_cv)
@ -469,7 +469,7 @@ class _ScriptRun:
if not self._script.top_level:
# We already consumed the response, do not pass it on
err.response = None
raise err
raise
except Exception:
script_execution_set("error")
raise