]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
patman: set the default config_fname argument value to None
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>
Tue, 20 Dec 2022 05:38:39 +0000 (00:38 -0500)
committerSimon Glass <sjg@chromium.org>
Fri, 6 Jan 2023 02:21:57 +0000 (19:21 -0700)
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>
tools/patman/__main__.py
tools/patman/settings.py

index 8e32655ad224eff5c88ff83804dd9141651bd097..37489304f7424cc04b8332edf7eb54a5bb95ca3d 100755 (executable)
@@ -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
index 5efad5ed7872ed804e9c6e59da8d7a619b0d0e39..8b846799dfa26c7c63a76665af372ef3ffa8709e 100644 (file)
@@ -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):