diff --git a/check.sh b/check.sh index 911396e963..58b00aa1ce 100755 --- a/check.sh +++ b/check.sh @@ -39,7 +39,7 @@ if ! ruff check .; then echo "* ruff found issues." >> "$GITHUB_STEP_SUMMARY" EXIT_STATUS=1 if $ON_GITHUB_CI; then - ruff check --format github --diff . + ruff check --output-format github --diff . else ruff check --diff . fi diff --git a/trio/_threads.py b/trio/_threads.py index b551d45d38..d44e4b68f8 100644 --- a/trio/_threads.py +++ b/trio/_threads.py @@ -409,10 +409,10 @@ def from_thread_check_cancelled() -> None: """ try: raise_cancel = PARENT_TASK_DATA.cancel_register[0] - except AttributeError: + except AttributeError as exc: raise RuntimeError( "this thread wasn't created by Trio, can't check for cancellation" - ) from None + ) from exc if raise_cancel is not None: raise_cancel()