From patchwork Fri May 22 02:29:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 246217 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Thu, 21 May 2020 20:29:02 -0600 Subject: [PATCH v3 3/5] patman: Use a dict in gitutil to avoid importing series In-Reply-To: <20200522022904.239301-1-sjg@chromium.org> References: <20200522022904.239301-1-sjg@chromium.org> Message-ID: <20200522022904.239301-3-sjg@chromium.org> Only a few members of this class are used and only in a test. To avoid importing the module, convert the test to use a dict. Signed-off-by: Simon Glass Reported-by: Stefan Bosch --- Changes in v3: None Changes in v2: None tools/patman/gitutil.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index 844f8759dec..0bac9824811 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -8,7 +8,6 @@ import subprocess import sys from patman import command -from patman import series from patman import settings from patman import terminal from patman import tools @@ -366,9 +365,9 @@ def EmailPatches(series, cover_fname, args, dry_run, raise_on_error, cc_fname, >>> alias['boys'] = ['fred', ' john'] >>> alias['all'] = ['fred ', 'john', ' mary '] >>> alias[os.getenv('USER')] = ['this-is-me at me.com'] - >>> series = series.Series() - >>> series.to = ['fred'] - >>> series.cc = ['mary'] + >>> series = {} + >>> series['to'] = ['fred'] + >>> series['cc'] = ['mary'] >>> EmailPatches(series, 'cover', ['p1', 'p2'], True, True, 'cc-fname', \ False, alias) 'git send-email --annotate --to "f.bloggs at napier.co.nz" --cc \ @@ -377,7 +376,7 @@ def EmailPatches(series, cover_fname, args, dry_run, raise_on_error, cc_fname, alias) 'git send-email --annotate --to "f.bloggs at napier.co.nz" --cc \ "m.poppins at cloud.net" --cc-cmd "./patman --cc-cmd cc-fname" p1' - >>> series.cc = ['all'] + >>> series['cc'] = ['all'] >>> EmailPatches(series, 'cover', ['p1', 'p2'], True, True, 'cc-fname', \ True, alias) 'git send-email --annotate --to "this-is-me at me.com" --cc-cmd "./patman \