Fixing bug when encountering tuple params

Change-Id: Id6cef580083747c31bef149251080be35ab2680a
Closes-bug: 1511767
This commit is contained in:
Timothy Kelsey 2015-11-11 11:28:58 +00:00
parent 6b19466d9c
commit a5618ba216
2 changed files with 8 additions and 3 deletions

View File

@ -75,6 +75,7 @@ def hardcoded_password_default(context):
# go through all (param, value)s and look for candidates
for key, val in zip(context.node.args.args, defs):
check = key.arg if sys.version_info.major > 2 else key.id # Py3
if isinstance(val, ast.Str) and check in candidates:
return _report(val.s)
if isinstance(key, ast.Name):
check = key.arg if sys.version_info.major > 2 else key.id # Py3
if isinstance(val, ast.Str) and check in candidates:
return _report(val.s)

View File

@ -16,3 +16,7 @@ def NoMatch2(password):
doLogin(password="blerg")
password = "blerg"
d["password"] = "blerg"
def NoMatch3((a, b)):
pass