added a pylint directive to ignore a harmless warning and changed code to avoid a pylint false positive