diff --git a/ci/scripts/towncrier_automation.py b/ci/scripts/towncrier_automation.py index f04aae0ca..5cc24186d 100755 --- a/ci/scripts/towncrier_automation.py +++ b/ci/scripts/towncrier_automation.py @@ -75,13 +75,13 @@ def main(argv: Sequence[str] | None = None) -> None: if Version(args.version).micro != 0 and not re.fullmatch( patch_branch_pattern, base_branch ): - raise NoPatchReleaseOnMainError( - f"Version {args.version} is a patch release, but you are trying to release from a non-patch release branch: {base_branch}." - ) + msg = f"Version {args.version} is a patch release, but " + "you are trying to release from a non-patch release branch: {base_branch}." + raise NoPatchReleaseOnMainError(msg) if Version(args.version).micro == 0 and base_branch != "main": - raise NoMinorMajorReleaseOffMainError( - f"Version {args.version} is a minor or major release, but you are trying to release not from main: {base_branch}." - ) + msg = f"Version {args.version} is a minor or major release, " + "but you are trying to release not from main: {base_branch}." + raise NoMinorMajorReleaseOffMainError(msg) pr_description = ( "" if base_branch == "main" else "@meeseeksmachine backport to main" )