tasks/release.py
def try_git_command(ctx, git_command):
    """
    Try a git command that should be retried (after user confirmation) if it fails.
    Primarily useful for commands which can fail if commit signing fails: we don't want the
    whole workflow to fail if that happens, we want to retry.
    """

    do_retry = True

    while do_retry:
        res = ctx.run(git_command, warn=True)
        if res.exited is None or res.exited > 0:
            print(
                color_message(
                    f"Failed to run \"{git_command}\" (did the commit/tag signing operation fail?)",
                    "orange",
                )
            )
            do_retry = yes_no_question("Do you want to retry this operation?", color="orange", default=True)
            continue

        return True

    return False

    Try a git command that should be retried (after user confirmation) if it fails.
    Primarily useful for commands which can fail if commit signing fails: we don't want the
    whole workflow to fail if that happens, we want to retry.
    
Try a git command that should be retried (after user confirmation) if it fails.
Primarily useful for commands which can fail if commit signing fails: we don't want the
whole workflow to fail if that happens, we want to retry.
Try a git command that should be retried ( after user confirmation ) if it fails . Primarily useful for commands which can fail if commit signing fails : we don ' t want the whole workflow to fail if that happens we want to retry .
def try_git_command(ctx, git_command):
    do_retry = True
    while do_retry:
        res = ctx.run(git_command, warn=True)
        if res.exited is None or res.exited > 0:
            print(
                color_message(
                    f"Failed to run \"{git_command}\" (did the commit/tag signing operation fail?)",
                    "orange",
                )
            )
            do_retry = yes_no_question("Do you want to retry this operation?", color="orange", default=True)
            continue
        return True
    return False
def try_git_command ( ctx , git_command ) : do_retry = True while do_retry : res = ctx . run ( git_command , warn = True ) if res . exited is None or res . exited > 0 : print ( color_message ( f"Failed to run \"{git_command}\" (did the commit/tag signing operation fail?)" , "orange" , ) ) do_retry = yes_no_question ( "Do you want to retry this operation?" , color = "orange" , default = True ) continue return True return False
Try a git command that should be retried (after user confirmation) if it fails.
Try a git command that should be retried ( after user confirmation ) if it fails .
"""
    Try a git command that should be retried (after user confirmation) if it fails.
    Primarily useful for commands which can fail if commit signing fails: we don't want the
    whole workflow to fail if that happens, we want to retry.
    """
ctx
git_command