style: use import error everywhere

Align with Google style guides and `import error` as a module rather
than import classes out of it.

Change-Id: I8686fbe7887bd6ceac7a07877af63934f0d0ddd2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/647563
Commit-Queue: Mike Frysinger <vapier@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Insaf Latypov <saferif@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Mike Frysinger authored and gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com committed 2026-10-22 17:44:11 -07:00
1 parent 4212588c20
commit 2c04b98c60
29 files changed
+321 -341

No files matched your search

+4 -5
View File
@@ -20,8 +20,7 @@ import subprocess
import sys
from typing import Any, Optional
from error import GitError
from error import RepoExitError
import error
from git_trace2_event_log_base import BaseEventLog
import platform_utils
from repo_logging import RepoLogger
@@ -604,14 +603,14 @@ class GitCommand:
return self.rc
class GitRequireError(RepoExitError):
class GitRequireError(error.RepoExitError):
"""Error raised when git version is unavailable or invalid."""
def __init__(self, message, exit_code: int = INVALID_GIT_EXIT_CODE):
super().__init__(message, exit_code=exit_code)
class GitCommandError(GitError):
class GitCommandError(error.GitError):
"""
Error raised from a failed git command.
Note that GitError can refer to any Git related error (e.g. branch not
@@ -691,7 +690,7 @@ class GitCommandError(GitError):
return string
class GitPopenCommandError(GitError):
class GitPopenCommandError(error.GitError):
"""
Error raised when subprocess.Popen fails for a GitCommand
"""