Skip to content

Commit

Permalink
fix: swallow SystemExit from pyupgrade --help argparse
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Dec 31, 2024
1 parent 0412519 commit 40a2bc4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/darker/formatters/pyupgrade_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def _get_supported_target_versions() -> set[tuple[int, int]]:
sys.stdout = buf = io.StringIO()
try:
main(["--help"])
except SystemExit: # expected from argparse
pass
finally:
sys.stdout = stdout
version_strs = (
Expand Down

0 comments on commit 40a2bc4

Please sign in to comment.