Skip to content

Conversation

@gvanrossum
Copy link
Collaborator

Sometimes you want to push an earlier release or while the repo is dirty. Use --force to disable the errors for those cases.

Remove two try: // except Exception as e: print(e); return blocks, they don't help anything (expected exceptions aren't handled this way, and for unexpected ones I strongly prefer to get the full traceback.

@gvanrossum gvanrossum changed the title Add --force flag to tools/release.py and change error handling (no 'except Exception') Add --force flag to tools/release.py and remove 'except Exception' Nov 23, 2025
@gvanrossum gvanrossum requested a review from robgruen November 23, 2025 19:52
tools/release.py Outdated
if args.force:
print(
f"Error: New version {args.version} must be higher than current version {current_version}",
f"Warning: New version {args.version} precedes current version {current_version}. (forced)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "matches or precedes"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants