From fe13274f0255b9d98e98d0b1e28bdd4c122ee9b7 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Wed, 2 Sep 2020 09:43:05 -0700 Subject: [PATCH] fix linter warnings --- humanfriendly/tests.py | 6 +++--- humanfriendly/usage.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/humanfriendly/tests.py b/humanfriendly/tests.py index 4e8c019..446e300 100644 --- a/humanfriendly/tests.py +++ b/humanfriendly/tests.py @@ -787,8 +787,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 line for line in lines)) + self.assertTrue(all('%' in line for line in lines)) self.assertEqual(sorted(set(lines)), sorted(lines)) def test_automatic_spinner(self): @@ -952,7 +952,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(line) for line 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..a045acb 100644 --- a/humanfriendly/usage.py +++ b/humanfriendly/usage.py @@ -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' % line for line in csv_lines)) logger.debug("Rendered output: %s", output) return '\n\n'.join(trim_empty_lines(o) for o in output)