diff options
author | Simon Glass <sjg@chromium.org> | 2020-06-07 06:45:49 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-07-09 18:57:22 -0600 |
commit | dd3dac2f2cd8bc008f11e0108d3fb64d0e4e8fd9 (patch) | |
tree | ebed7b50c459f8bbf2030e935fa1e63522043994 /tools/patman/settings.py | |
parent | 156e655372f4221844d3483045dfdeffbb8bd0b1 (diff) |
patman: Avoid importing gitutil in settings
Pass this module in so that settings does not need to import it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Stefan Bosch <stefan_b@posteo.net>
Diffstat (limited to 'tools/patman/settings.py')
-rw-r--r-- | tools/patman/settings.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/patman/settings.py b/tools/patman/settings.py index ca74fc611f..635561ac05 100644 --- a/tools/patman/settings.py +++ b/tools/patman/settings.py @@ -11,7 +11,6 @@ import os import re from patman import command -from patman import gitutil from patman import tools """Default settings per-project. @@ -185,7 +184,7 @@ def ReadGitAliases(fname): fd.close() -def CreatePatmanConfigFile(config_fname): +def CreatePatmanConfigFile(gitutil, config_fname): """Creates a config file under $(HOME)/.patman if it can't find one. Args: @@ -301,7 +300,7 @@ def GetItems(config, section): except: raise -def Setup(parser, project_name, config_fname=''): +def Setup(gitutil, parser, project_name, config_fname=''): """Set up the settings module by reading config files. Args: @@ -318,7 +317,7 @@ def Setup(parser, project_name, config_fname=''): if not os.path.exists(config_fname): print("No config file found ~/.patman\nCreating one...\n") - CreatePatmanConfigFile(config_fname) + CreatePatmanConfigFile(gitutil, config_fname) config.read(config_fname) |