Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
| UseofApply.py:19:3:19:17 | ControlFlowNode for apply() | Call to the obsolete builtin function 'apply'. |
| expressions_test.py:3:5:3:21 | ControlFlowNode for apply() | Call to the obsolete builtin function 'apply'. |
| expressions_test.py:2:5:2:21 | ControlFlowNode for apply() | Call to the obsolete builtin function 'apply'. |
15 changes: 13 additions & 2 deletions python/ql/test/2/query-tests/Expressions/expressions_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@

def use_of_apply(func, args):
apply(func, args)


def use_of_input():
return input()
return input() # NOT OK


def not_use_of_input():
input = raw_input
return input() # OK


if __name__ == "__main__":
# if you enter 4+4 each time, you'll see that results are: 8, '4+4', 8
print("result:", use_of_input())
print("result:", not_use_of_input())
print("result:", use_of_input())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first, I was like "why test this again?", but I'm guessing now that this is to test that input is unaffected by the call to not_use_of_input.