pylint: Ignore usage of 'unicode' before assignment

New versions of pylint ignore Python 2 functions and types, evaluating
'unicode' as "undefined". ansible-freeipa will always define 'unicode'
when running under Python 3, and it is always defined under Python 2.

This patch fixes these false positives.
This commit is contained in:
Rafael Guterres Jeffman
2024-05-22 10:04:22 -03:00
parent 60905ef5bf
commit f53ca3ad39
8 changed files with 13 additions and 8 deletions

View File

@@ -293,7 +293,7 @@ def result_get_value_lowercase(res_find, key, default=None):
if existing is not None:
if isinstance(existing, (list, tuple)):
existing = [to_text(item).lower() for item in existing]
if isinstance(existing, (str, unicode)):
if isinstance(existing, (str, unicode)): # pylint: disable=E0606
existing = existing.lower()
else:
existing = default