aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-12-20 00:38:39 -0500
committerSimon Glass <sjg@chromium.org>2023-01-05 19:21:57 -0700
commit2c58a5e2753e4f0afc4c937b07b9380398bbe8fd (patch)
tree19bbca2b8a8c83bc389d85a57abcbad43756eeb6 /tools
parent57e3b03fe1ea225eb45ccfa3b0f2d564d95a4717 (diff)
downloadu-boot-2c58a5e2753e4f0afc4c937b07b9380398bbe8fd.zip
u-boot-2c58a5e2753e4f0afc4c937b07b9380398bbe8fd.tar.gz
u-boot-2c58a5e2753e4f0afc4c937b07b9380398bbe8fd.tar.bz2
patman: set the default config_fname argument value to None
This better matches Python conventions, allowing to easily test whether the optional argument is provided. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/patman/__main__.py2
-rw-r--r--tools/patman/settings.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/tools/patman/__main__.py b/tools/patman/__main__.py
index 8e32655..3748930 100755
--- a/tools/patman/__main__.py
+++ b/tools/patman/__main__.py
@@ -117,7 +117,7 @@ status.add_argument('-f', '--force', action='store_true',
argv = sys.argv[1:]
args, rest = parser.parse_known_args(argv)
if hasattr(args, 'project'):
- settings.Setup(parser, args.project, '')
+ settings.Setup(parser, args.project)
args, rest = parser.parse_known_args(argv)
# If we have a command, it is safe to parse all arguments
diff --git a/tools/patman/settings.py b/tools/patman/settings.py
index 5efad5e..8b84679 100644
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -333,19 +333,20 @@ def GetItems(config, section):
return []
-def Setup(parser, project_name, config_fname=''):
+def Setup(parser, project_name, config_fname=None):
"""Set up the settings module by reading config files.
Args:
- parser: The parser to update
+ parser: The parser to update.
project_name: Name of project that we're working on; we'll look
for sections named "project_section" as well.
- config_fname: Config filename to read ('' for default)
+ config_fname: Config filename to read.
"""
# First read the git alias file if available
_ReadAliasFile('doc/git-mailrc')
config = _ProjectConfigParser(project_name)
- if config_fname == '':
+
+ if not config_fname:
config_fname = '%s/.patman' % os.getenv('HOME')
if not os.path.exists(config_fname):