From 785ba29d62c1a9a693776969a6be47ae3676390d Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 2 Jun 2020 15:24:57 +0000 Subject: [PATCH 1/2] python-test.py: Do not use letter similar to numbers Running pycodestyle currently reports cases which is one of a set of three style checks to avoid ambiguous single letter names which look like numbers ./src/tests/python-test.py:54:35: E741 ambiguous variable name 'l' ./src/tests/python-test.py:102:38: E741 ambiguous variable name 'l' https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes --- src/tests/python-test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/python-test.py b/src/tests/python-test.py index b66bf3966..036ea8b3b 100644 --- a/src/tests/python-test.py +++ b/src/tests/python-test.py @@ -51,7 +51,7 @@ class LocalTest(unittest.TestCase): kw = {} for key, value in \ - [l.split(':') for l in output.split('\n') if ":" in l]: + [ln.split(':') for ln in output.split('\n') if ":" in ln]: kw[key] = value.strip() del kw['asq'] @@ -99,7 +99,7 @@ class LocalTest(unittest.TestCase): return [] members = [value.strip() for key, value in - [l.split(':') for l in output.split('\n') if ":" in l] + [ln.split(':') for ln in output.split('\n') if ":" in ln] if key == "memberof"] return members -- 2.27.0 From 96f3e8f2f10ed687e6729202d2a5ffe9c92ef870 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 2 Jun 2020 15:27:53 +0000 Subject: [PATCH 2/2] INTG: Do not use letter similar to numbers in python code Running pycodestyle currently reports cases which is one of a set of three style checks to avoid ambiguous single letter names which look like numbers ./src/tests/intg/krb5utils.py:101:27: E741 ambiguous variable name 'l' ./src/tests/intg/krb5utils.py:116:23: E741 ambiguous variable name 'l' ./src/tests/intg/krb5utils.py:140:28: E741 ambiguous variable name 'l' https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes --- src/tests/intg/krb5utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/intg/krb5utils.py b/src/tests/intg/krb5utils.py index 50e4789b5..67ae43006 100644 --- a/src/tests/intg/krb5utils.py +++ b/src/tests/intg/krb5utils.py @@ -98,7 +98,7 @@ class Krb5Utils(object): if retval != 0: return 0 - outlines = [l for l in out.split('\n') if len(l) > 1] + outlines = [ln for ln in out.split('\n') if len(ln) > 1] return len(outlines) - 2 def list_princs(self, env=None): @@ -113,7 +113,7 @@ class Krb5Utils(object): if len(outlines) < 2: raise Exception("Not enough output from klist -l") - return [l for l in outlines[2:] if len(l) > 0] + return [ln for ln in outlines[2:] if len(ln) > 0] def has_principal(self, exp_principal, exp_cache=None, env=None): try: @@ -137,7 +137,7 @@ class Krb5Utils(object): thisrealm = None ccache_dict = dict() - for line in [l for l in out.split('\n') if len(l) > 0]: + for line in [ln for ln in out.split('\n') if len(ln) > 0]: if line.startswith("Default principal"): dflprinc = line.split()[2] thisrealm = '@' + dflprinc.split('@')[1] -- 2.27.0