mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Python: Add syntactic support for yield in contextlib.contextmanager
This commit is contained in:
@@ -223,8 +223,8 @@ def managed_resource():
|
||||
yield x # $ tracked
|
||||
|
||||
def test_context_manager():
|
||||
with managed_resource() as x: # $ MISSING: tracked
|
||||
print(x) # $ MISSING: tracked
|
||||
with managed_resource() as x: # $ tracked
|
||||
print(x) # $ tracked
|
||||
|
||||
@contextlib.contextmanager
|
||||
def managed_resource2():
|
||||
@@ -232,5 +232,5 @@ def managed_resource2():
|
||||
yield x # $ tracked
|
||||
|
||||
def test_context_manager2():
|
||||
with managed_resource2() as x: # $ MISSING: tracked
|
||||
print(x) # $ MISSING: tracked
|
||||
with managed_resource2() as x: # $ tracked
|
||||
print(x) # $ tracked
|
||||
|
||||
Reference in New Issue
Block a user