From f4323c5aca4a0a4354d075d38f266b409856931e Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Tue, 1 Dec 2020 00:58:14 +0100 Subject: [PATCH] "Fix" silly new flake8 invention (E741) --- humanfriendly/tests.py | 6 +++--- humanfriendly/usage.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/humanfriendly/tests.py b/humanfriendly/tests.py index 933e19e..92fb92d 100644 --- a/humanfriendly/tests.py +++ b/humanfriendly/tests.py @@ -793,8 +793,8 @@ def test_spinner(self): .replace(ANSI_HIDE_CURSOR, '')) lines = [line for line in output.split(ANSI_ERASE_LINE) if line] self.assertTrue(len(lines) > 0) - self.assertTrue(all('test spinner' in l for l in lines)) - self.assertTrue(all('%' in l for l in lines)) + self.assertTrue(all('test spinner' in ln for ln in lines)) + self.assertTrue(all('%' in ln for ln in lines)) self.assertEqual(sorted(set(lines)), sorted(lines)) def test_automatic_spinner(self): @@ -958,7 +958,7 @@ def test_cli(self): # https://github.com/xolox/python-humanfriendly/issues/28 returncode, output = run_cli(main, '--demo') assert returncode == 0 - lines = [ansi_strip(l) for l in output.splitlines()] + lines = [ansi_strip(ln) for ln in output.splitlines()] assert "Text styles:" in lines assert "Foreground colors:" in lines assert "Background colors:" in lines diff --git a/humanfriendly/usage.py b/humanfriendly/usage.py index 99a6b59..df98adf 100644 --- a/humanfriendly/usage.py +++ b/humanfriendly/usage.py @@ -1,7 +1,7 @@ # Human friendly input/output in Python. # # Author: Peter Odding -# Last Change: June 24, 2017 +# Last Change: December 1, 2020 # URL: https://humanfriendly.readthedocs.io """ @@ -258,7 +258,7 @@ def render_usage(text): ('\n\n'.join(render_paragraph(p, meta_variables) for p in split_paragraphs(description))).rstrip(), ]) csv_lines = csv_buffer.getvalue().splitlines() - output.append('\n'.join(' %s' % l for l in csv_lines)) + output.append('\n'.join(' %s' % ln for ln in csv_lines)) logger.debug("Rendered output: %s", output) return '\n\n'.join(trim_empty_lines(o) for o in output)