Skip to content

Commit 6f0faec

Browse files
[ruff] Fix redefined argument 'exc'
1 parent 28b03b3 commit 6f0faec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/_pytest/_io/saferepr.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def _format_repr_exception(exc: BaseException, obj: object) -> str:
1818
exc_info = _try_repr_or_str(exc)
1919
except (KeyboardInterrupt, SystemExit):
2020
raise
21-
except BaseException as exc:
22-
exc_info = f"unpresentable exception ({_try_repr_or_str(exc)})"
21+
except BaseException as inner_exc:
22+
exc_info = f"unpresentable exception ({_try_repr_or_str(inner_exc)})"
2323
return (
2424
f"<[{exc_info} raised in repr()] {type(obj).__name__} object at 0x{id(obj):x}>"
2525
)

0 commit comments

Comments
 (0)