mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Python: Add globals() == locals() test
This commit is contained in:
@@ -3,3 +3,4 @@
|
||||
| test.py:101:5:101:14 | Attribute() | Modification of the locals() dictionary will have no effect on the local variables. |
|
||||
| test.py:102:9:102:14 | Subscript | Modification of the locals() dictionary will have no effect on the local variables. |
|
||||
| test.py:103:5:103:13 | Attribute() | Modification of the locals() dictionary will have no effect on the local variables. |
|
||||
| test.py:110:1:110:15 | Subscript | Modification of the locals() dictionary will have no effect on the local variables. |
|
||||
|
||||
@@ -104,10 +104,10 @@ def modification_of_locals():
|
||||
return x
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
globals()['foo'] = 42 # OK
|
||||
# in module-level scope `locals() == globals()`
|
||||
# FP report from https://github.com/github/codeql/issues/6674
|
||||
locals()['foo'] = 43 # technically OK
|
||||
|
||||
|
||||
#C-style things
|
||||
|
||||
Reference in New Issue
Block a user