If pygit2 does not exist, patman refuses to work at all, but most subcommands don't need it. Move the imports to resolve this.
Signed-off-by: Simon Glass <s...@chromium.org> --- tools/patman/control.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/patman/control.py b/tools/patman/control.py index 3e09b16e87b..e10125e2581 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -21,8 +21,6 @@ from u_boot_pylib import gitutil from u_boot_pylib import terminal from u_boot_pylib import tools from u_boot_pylib import tout -from patman import cseries -from patman import cser_helper from patman import patchstream from patman.patchwork import Patchwork from patman import send @@ -73,6 +71,8 @@ def patchwork_status(branch, count, start, end, dest_branch, force, Raises: ValueError: if the branch has no Series-link value """ + from patman import cser_helper + if not branch: branch = gitutil.get_branch() if count == -1: @@ -124,6 +124,8 @@ def do_series(args, test_db=None, pwork=None, cser=None): needed cser (Cseries): Cseries object to use, None to create one """ + from patman import cseries + if not cser: cser = cseries.Cseries(test_db) needs_patchwork = [ @@ -226,6 +228,8 @@ def upstream(args, test_db=None): test_db (str or None): Directory containing the test database, None to use the normal one """ + from patman import cseries + cser = cseries.Cseries(test_db) try: cser.open_database() @@ -257,6 +261,8 @@ def patchwork(args, test_db=None, pwork=None): use the normal one pwork (Patchwork): Patchwork object to use """ + from patman import cseries + cser = cseries.Cseries(test_db) try: cser.open_database() -- 2.43.0 base-commit: e3ced530e543c9f24cbc66430abc6109ce8df015 branch: pate