152 len(context.node.args.defaults)) |
151 len(context.node.args.defaults)) |
153 defs.extend(context.node.args.defaults) |
152 defs.extend(context.node.args.defaults) |
154 |
153 |
155 # go through all (param, value)s and look for candidates |
154 # go through all (param, value)s and look for candidates |
156 for key, val in zip(context.node.args.args, defs): |
155 for key, val in zip(context.node.args.args, defs): |
157 isPy3Arg = True |
156 if isinstance(key, ast.Name) or isinstance(key, ast.arg): |
158 if sys.version_info[0] > 2: |
157 if AstUtilities.isString(val) and RE_CANDIDATES.search(key.arg): |
159 isPy3Arg = isinstance(key, ast.arg) |
|
160 if isinstance(key, ast.Name) or isPy3Arg: |
|
161 check = key.arg if sys.version_info[0] > 2 else key.id # Py3 |
|
162 if AstUtilities.isString(val) and RE_CANDIDATES.search(check): |
|
163 reportError( |
158 reportError( |
164 context.node.lineno - 1, |
159 context.node.lineno - 1, |
165 context.node.col_offset, |
160 context.node.col_offset, |
166 "S107", |
161 "S107", |
167 "L", |
162 "L", |