mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Add a few function-local import tests
This commit is contained in:
@@ -96,3 +96,14 @@ from known import *
|
||||
|
||||
def secretly_use_known():
|
||||
print(known_attr) # $reads=known_attr
|
||||
|
||||
# Local import in function
|
||||
|
||||
def imports_locally():
|
||||
import mod1
|
||||
|
||||
# Global import hidden in function
|
||||
|
||||
def imports_stuff():
|
||||
global mod2
|
||||
import mod2 # $writes=mod2
|
||||
|
||||
Reference in New Issue
Block a user