[rtems-tools commit] rtemstoolkit/mailer.py: Fix option ordering for add_arguments

Joel Sherrill joel at rtems.org
Mon May 10 16:47:33 UTC 2021


Module:    rtems-tools
Branch:    master
Commit:    f18e6d8e1573e9c924d43ed2e5966d5be41bfaa7
Changeset: http://git.rtems.org/rtems-tools/commit/?id=f18e6d8e1573e9c924d43ed2e5966d5be41bfaa7

Author:    Alex White <alex.white at oarcorp.com>
Date:      Wed May  5 09:04:49 2021 -0500

rtemstoolkit/mailer.py: Fix option ordering for add_arguments

The ordering of keys cannot be guaranteed in a dictionary. This changes
the options iteration to no longer rely on key ordering.

Closes #4402

---

 rtemstoolkit/mailer.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rtemstoolkit/mailer.py b/rtemstoolkit/mailer.py
index ae51d78..085a2ce 100644
--- a/rtemstoolkit/mailer.py
+++ b/rtemstoolkit/mailer.py
@@ -1,6 +1,7 @@
 #
 # RTEMS Tools Project (http://www.rtems.org/)
 # Copyright 2013-2016 Chris Johns (chrisj at rtems.org)
+# Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
 # All rights reserved.
 #
 # This file is part of the RTEMS Tools package in 'rtems-tools'.
@@ -61,7 +62,8 @@ def append_options(opts):
 def add_arguments(argsp):
     argsp.add_argument('--mail', help = _options['--mail'], action = 'store_true')
     argsp.add_argument('--use-gitconfig', help = _options['--use-gitconfig'], action = 'store_true')
-    for o in list(_options)[1:]:
+    no_add = ['--mail', '--use-gitconfig']
+    for o in [opt for opt in list(_options) if opt not in no_add]:
         argsp.add_argument(o, help = _options[o], type = str)
 
 class mail:



More information about the vc mailing list