Skip to content

Commit d3e68d2

Browse files
Prefer checking for POSIX outside _is_shlex_quote_call function (#11)
1 parent 63db2d7 commit d3e68d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pylint_secure_coding_standard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def _is_jsonpickle_encode_call(node):
212212

213213

214214
def _is_shlex_quote_call(node):
215-
return not _is_posix() and (
215+
return (
216216
isinstance(node.func, astroid.Attribute)
217217
and isinstance(node.func.expr, astroid.Name)
218218
and node.func.expr.name == 'shlex'
@@ -320,7 +320,7 @@ def visit_call(self, node):
320320
self.add_message('replace-builtin-open', node=node)
321321
elif isinstance(node.func, astroid.Name) and (node.func.name in ('eval', 'exec')):
322322
self.add_message('avoid-eval-exec', node=node)
323-
elif _is_shlex_quote_call(node):
323+
elif not _is_posix() and _is_shlex_quote_call(node):
324324
self.add_message('avoid-shlex-quote-on-non-posix', node=node)
325325

326326
def visit_import(self, node):

0 commit comments

Comments
 (0)