mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Python: Expand test of py/use-of-input
This commit is contained in:
@@ -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'. |
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
|
||||
def use_of_apply(func, args):
|
||||
apply(func, args)
|
||||
|
||||
def use_of_input():
|
||||
return input()
|
||||
|
||||
def use_of_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())
|
||||
|
||||
Reference in New Issue
Block a user